[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 });
|
||||
mkdirp.sync(downloadPath);
|
||||
|
||||
log('Modules', 'Base:', basePath);
|
||||
log('Modules', 'Manifest:', manifestPath);
|
||||
log('Modules', 'Download:', downloadPath);
|
||||
|
||||
try {
|
||||
installed = JSON.parse(fs.readFileSync(manifestPath));
|
||||
} catch (e) {
|
||||
bootstrapping = true;
|
||||
}
|
||||
|
||||
|
||||
hostUpdater = require('./hostUpdater');
|
||||
|
||||
hostUpdater.on('checking-for-update', () => events.emit('checking-for-updates'));
|
||||
|
@ -183,7 +180,7 @@ const checkModules = async () => {
|
|||
const rem = remote[name];
|
||||
|
||||
if (inst !== rem) {
|
||||
log('Modules', 'Update:', `${name}@${rem}`, `[installed: ${inst}]`, `[remote: ${rem}]`);
|
||||
log('Modules', 'Update:', name, '|', inst, '->', rem);
|
||||
todo.push({ name, version: rem });
|
||||
}
|
||||
}
|
||||
|
@ -350,7 +347,7 @@ const finishInstall = (name, ver, success) => {
|
|||
installing.done++;
|
||||
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;
|
||||
log('Modules', 'Done installs', `| ${succeeded}/${installing.total} success`);
|
||||
|
||||
|
|
Loading…
Reference in a new issue