diff --git a/lib/API/Startup.js b/lib/API/Startup.js index b8773a40d..f4d42c121 100644 --- a/lib/API/Startup.js +++ b/lib/API/Startup.js @@ -29,11 +29,11 @@ module.exports = function(CLI) { } if (opts.user) { - console.log('sudo env PATH=$PATH:' + path.dirname(process.execPath) + ' pm2 ' + opts.args[1].name() + ' ' + platform + ' -u ' + opts.user + ' --hp ' + process.env.HOME); + console.log('sudo env PATH="$PATH:' + path.dirname(process.execPath) + '" pm2 ' + opts.args[1].name() + ' ' + platform + ' -u ' + opts.user + ' --hp ' + process.env.HOME); return cb(new Error('You have to run this with elevated rights')); } return sexec('whoami', {silent: true}, function(err, stdout, stderr) { - console.log('sudo env PATH=$PATH:' + path.dirname(process.execPath) + ' ' + pm2_bin_path + ' ' + opts.args[1].name() + ' ' + platform + ' -u ' + stdout.trim() + ' --hp ' + process.env.HOME); + console.log('sudo env PATH="$PATH:' + path.dirname(process.execPath) + '" ' + pm2_bin_path + ' ' + opts.args[1].name() + ' ' + platform + ' -u ' + stdout.trim() + ' --hp ' + process.env.HOME); return cb(new Error('You have to run this with elevated rights')); }); }