mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-08 01:10:03 +02:00
🐛 Fix crash if engine directory does not exist
This commit is contained in:
parent
c8484ec8d8
commit
2fc60b26eb
1 changed files with 2 additions and 2 deletions
|
@ -127,8 +127,8 @@ export async function downloadInternals({ version, force }: { version: string, f
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the engine directory is empty, we should delete it.
|
// If the engine directory is empty, we should delete it.
|
||||||
const engineIsEmpty = await readdir(ENGINE_DIR).then((files) => files.length === 0)
|
const engineIsEmpty = existsSync(ENGINE_DIR) && await readdir(ENGINE_DIR).then((files) => files.length === 0)
|
||||||
if (existsSync(ENGINE_DIR) && engineIsEmpty) {
|
if (engineIsEmpty) {
|
||||||
log.info("'engine/' is empty, it...")
|
log.info("'engine/' is empty, it...")
|
||||||
rmSync(ENGINE_DIR, { recursive: true })
|
rmSync(ENGINE_DIR, { recursive: true })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue