mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added option to auto-clean NPM cache on update. #3225
This commit is contained in:
parent
04876bf823
commit
0b38049015
3 changed files with 10 additions and 1 deletions
|
@ -467,7 +467,15 @@ function CreateMeshCentralServer(config, args) {
|
|||
xxprocess.stderr.on('data', function (data) { xxprocess.data += data; });
|
||||
xxprocess.on('close', function (code) {
|
||||
if (code == 0) { console.log('Update completed...'); }
|
||||
setTimeout(function () { obj.launchChildServer(startArgs); }, 1000);
|
||||
if (obj.args.cleannpmcacheonupdate === true) {
|
||||
// Perform NPM cache clean
|
||||
console.log('Cleaning NPM cache...');
|
||||
var xxxprocess = child_process.exec(npmpath + ' cache clean --force', { maxBuffer: Infinity, cwd: obj.parentpath, env: env }, function (error, stdout, stderr) { });
|
||||
xxxprocess.on('close', function (code) { setTimeout(function () { obj.launchChildServer(startArgs); }, 1000); });
|
||||
} else {
|
||||
// Run the updated server
|
||||
setTimeout(function () { obj.launchChildServer(startArgs); }, 1000);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (error != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue