From 222ec88844ce7fa53f0606b70bc7fd30c4a433cb Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 22 Dec 2019 12:44:16 -0800 Subject: [PATCH] Fixed MeshCentral server update on Windows. --- meshcentral.js | 4 ++-- package.json | 2 +- webserver.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/meshcentral.js b/meshcentral.js index 178839fa..f79a3d29 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -232,7 +232,7 @@ function CreateMeshCentralServer(config, args) { var child_process = require('child_process'); var npmpath = ((typeof obj.args.npmpath == 'string') ? obj.args.npmpath : 'npm'); var npmproxy = ((typeof obj.args.npmproxy == 'string') ? (' --proxy ' + obj.args.npmproxy) : ''); - var env = {}; + var env = Object.assign({}, process.env); // Shallow clone if (typeof obj.args.npmproxy == 'string') { env['HTTP_PROXY'] = env['HTTPS_PROXY'] = env['http_proxy'] = env['https_proxy'] = obj.args.npmproxy; } var xxprocess = child_process.exec(npmpath + ' install meshcentral' + version + npmproxy, { maxBuffer: Infinity, cwd: obj.parentpath, env: env }, function (error, stdout, stderr) { }); xxprocess.data = ''; @@ -282,7 +282,7 @@ function CreateMeshCentralServer(config, args) { var child_process = require('child_process'); var npmpath = ((typeof obj.args.npmpath == 'string') ? obj.args.npmpath : 'npm'); var npmproxy = ((typeof obj.args.npmproxy == 'string') ? (' --proxy ' + obj.args.npmproxy) : ''); - var env = {}; + var env = Object.assign({}, process.env); // Shallow clone if (typeof obj.args.npmproxy == 'string') { env['HTTP_PROXY'] = env['HTTPS_PROXY'] = env['http_proxy'] = env['https_proxy'] = obj.args.npmproxy; } var xxprocess = child_process.exec(npmpath + npmproxy + ' view meshcentral dist-tags.latest', { maxBuffer: 512000, cwd: obj.parentpath, env: env }, function (error, stdout, stderr) { }); xxprocess.data = ''; diff --git a/package.json b/package.json index c1c91cf8..e88adfa9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.4.6-i", + "version": "0.4.6-j", "keywords": [ "Remote Management", "Intel AMT", diff --git a/webserver.js b/webserver.js index 882c8e11..4c1f4840 100644 --- a/webserver.js +++ b/webserver.js @@ -2930,7 +2930,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { archive.on('error', function (err) { throw err; }); // Set the archive name - res.attachment((domain.title ? domain.title : "Meshcentral") + '-Backup-' + new Date().toLocaleDateString().replace('/', '-').replace('/', '-') + '.zip'); + res.attachment((domain.title ? domain.title : 'MeshCentral') + '-Backup-' + new Date().toLocaleDateString().replace('/', '-').replace('/', '-') + '.zip'); // Pipe archive data to the file archive.pipe(res);