fix(routes): complete post-refactor dependency wiring cleanup

This commit is contained in:
Krystie
2026-05-02 20:43:39 -07:00
parent 4eebb3ce7a
commit 0c658a26a8
32 changed files with 495 additions and 396 deletions

View File

@@ -88,7 +88,7 @@ class SelfUpdater extends EventEmitter {
let commit = null;
try {
commit = fs.readFileSync(path.join(__dirname, 'VERSION'), 'utf8').trim();
} catch (_) {}
} catch { /* ignore */ }
return { version: pkg.version, commit };
} catch (e) {
return { version: '0.0.0', commit: null };
@@ -164,7 +164,7 @@ class SelfUpdater extends EventEmitter {
} catch (dlErr) {
console.warn('[SelfUpdater] Primary download failed:', dlErr.message, '— trying mirror');
// Ensure file is fully cleaned up before mirror attempt
try { fs.unlinkSync(tarballPath); } catch (_) {}
try { fs.unlinkSync(tarballPath); } catch { /* ignore */ }
await this._downloadFile(mirrorUrl, tarballPath);
}
@@ -473,7 +473,7 @@ class SelfUpdater extends EventEmitter {
const sub = path.join(baseDir, entry, name);
if (fs.existsSync(sub)) return sub;
}
} catch (_) {}
} catch { /* ignore */ }
return null;
}
@@ -512,7 +512,7 @@ class SelfUpdater extends EventEmitter {
async _cleanDir(dir) {
try {
await fsp.rm(dir, { recursive: true, force: true });
} catch (_) {}
} catch { /* ignore */ }
await fsp.mkdir(dir, { recursive: true });
}
}