[Updater > Module] Minor source cleanup
This commit is contained in:
parent
956f1d7ad9
commit
9f23ae84bb
1 changed files with 3 additions and 6 deletions
|
@ -53,16 +53,13 @@ exports.init = (endpoint, _settings, buildInfo) => {
|
||||||
fs.rmSync(downloadPath, { recursive: true, force: true });
|
fs.rmSync(downloadPath, { recursive: true, force: true });
|
||||||
mkdirp.sync(downloadPath);
|
mkdirp.sync(downloadPath);
|
||||||
|
|
||||||
log('Modules', 'Base:', basePath);
|
|
||||||
log('Modules', 'Manifest:', manifestPath);
|
|
||||||
log('Modules', 'Download:', downloadPath);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
installed = JSON.parse(fs.readFileSync(manifestPath));
|
installed = JSON.parse(fs.readFileSync(manifestPath));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
bootstrapping = true;
|
bootstrapping = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
hostUpdater = require('./hostUpdater');
|
hostUpdater = require('./hostUpdater');
|
||||||
|
|
||||||
hostUpdater.on('checking-for-update', () => events.emit('checking-for-updates'));
|
hostUpdater.on('checking-for-update', () => events.emit('checking-for-updates'));
|
||||||
|
@ -183,7 +180,7 @@ const checkModules = async () => {
|
||||||
const rem = remote[name];
|
const rem = remote[name];
|
||||||
|
|
||||||
if (inst !== rem) {
|
if (inst !== rem) {
|
||||||
log('Modules', 'Update:', `${name}@${rem}`, `[installed: ${inst}]`, `[remote: ${rem}]`);
|
log('Modules', 'Update:', name, '|', inst, '->', rem);
|
||||||
todo.push({ name, version: rem });
|
todo.push({ name, version: rem });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -350,7 +347,7 @@ const finishInstall = (name, ver, success) => {
|
||||||
installing.done++;
|
installing.done++;
|
||||||
log('Modules', 'Finished', `${name}@${ver}`);
|
log('Modules', 'Finished', `${name}@${ver}`);
|
||||||
|
|
||||||
if ((bootstrapping && installing.done === installing.total) || installing.done === downloading.total) {
|
if (installing.done === (downloading.total || installing.done)) {
|
||||||
const succeeded = installing.total - installing.fail;
|
const succeeded = installing.total - installing.fail;
|
||||||
log('Modules', 'Done installs', `| ${succeeded}/${installing.total} success`);
|
log('Modules', 'Done installs', `| ${succeeded}/${installing.total} success`);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue