Skip to content

Commit 50b6ee9

Browse files
authored
refactor: ipfs-on-path should never fail on boot (#1769)
I don't believe windows scripts are safe, this ensures they won't break ipfs-desktop boot process.
1 parent b35d27e commit 50b6ee9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ipfs-on-path/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,13 @@ async function firstTime () {
7676
// to sudo so the user doesn't get annoying prompts when running IPFS Desktop
7777
// for the first time. Sets the option according to the success or failure of the
7878
// procedure.
79-
const res = await run('install', { trySudo: false, failSilently: true })
80-
store.set(CONFIG_KEY, res)
79+
try {
80+
const res = await run('install', { trySudo: false, failSilently: true })
81+
store.set(CONFIG_KEY, res)
82+
} catch (err) {
83+
logger.error(`[ipfs on path] unexpected error while no-sudo install: ${err.toString()}`)
84+
store.set(CONFIG_KEY, false)
85+
}
8186
}
8287

8388
async function runWindows (script, { failSilently }) {

0 commit comments

Comments
 (0)