Skip to content

Commit fbebc56

Browse files
committed
Handle 'webextension config already exists' issues
Not totally clear why the config would already exist in these cases, but it's definitely harmless, and I can easily imagine cases (crashes, other cleanup issues) where this will always happen intermittently.
1 parent fa3a60f commit fbebc56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/webextension.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ async function ensureWebExtensionInstalled() {
2626
const configPath = path.join(webExtensionPath, 'config');
2727

2828
await copyRecursive(WEBEXTENSION_BASE_PATH, webExtensionPath);
29-
await mkDir(configPath);
29+
await mkDir(configPath).catch((e: any) => {
30+
if (e.code === 'EEXIST') return; // Already exists, no problem
31+
else throw e;
32+
});
3033

3134
WEBEXTENSION_INSTALL = { path: webExtensionPath, configPath };
3235
console.log(`Webextension installed at ${WEBEXTENSION_INSTALL.path}`);

0 commit comments

Comments
 (0)