Phase 1: Add ESLint/Prettier config + baseline auto-fixes
This commit is contained in:
@@ -185,7 +185,7 @@ class SelfUpdater extends EventEmitter {
|
||||
const frontendSrc = this._findDir(stagingDir, 'status');
|
||||
if (frontendSrc) {
|
||||
await this._copyDir(frontendSrc, this.config.frontendDir, [
|
||||
'dist', 'css', 'assets', 'vendor', 'index.html', 'sw.js'
|
||||
'dist', 'css', 'assets', 'vendor', 'index.html', 'sw.js',
|
||||
]);
|
||||
this.emit('update-progress', { step: 'frontend-updated', version: remoteInfo.version });
|
||||
}
|
||||
@@ -209,7 +209,7 @@ class SelfUpdater extends EventEmitter {
|
||||
};
|
||||
await fsp.writeFile(
|
||||
path.join(this.config.updatesDir, 'trigger.json'),
|
||||
JSON.stringify(trigger, null, 2)
|
||||
JSON.stringify(trigger, null, 2),
|
||||
);
|
||||
|
||||
// The host-side systemd service will handle the rest.
|
||||
@@ -312,7 +312,7 @@ class SelfUpdater extends EventEmitter {
|
||||
this.status = 'waiting';
|
||||
await fsp.writeFile(
|
||||
path.join(this.config.updatesDir, 'trigger.json'),
|
||||
JSON.stringify(trigger, null, 2)
|
||||
JSON.stringify(trigger, null, 2),
|
||||
);
|
||||
|
||||
this._addToHistory({
|
||||
@@ -412,12 +412,12 @@ class SelfUpdater extends EventEmitter {
|
||||
try {
|
||||
resolve(JSON.parse(data));
|
||||
} catch (e) {
|
||||
reject(new Error('Invalid JSON from ' + url));
|
||||
reject(new Error(`Invalid JSON from ${ url}`));
|
||||
}
|
||||
});
|
||||
});
|
||||
req.on('error', reject);
|
||||
req.on('timeout', () => { req.destroy(); reject(new Error('Timeout fetching ' + url)); });
|
||||
req.on('timeout', () => { req.destroy(); reject(new Error(`Timeout fetching ${ url}`)); });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -459,7 +459,7 @@ class SelfUpdater extends EventEmitter {
|
||||
try {
|
||||
execSync(`tar xzf "${tarballPath}" -C "${destDir}" --strip-components=1`, { stdio: 'pipe' });
|
||||
} catch (e) {
|
||||
throw new Error('Failed to extract tarball: ' + e.message);
|
||||
throw new Error(`Failed to extract tarball: ${ e.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user