diff --git a/lib/API/Extra.js b/lib/API/Extra.js index d49bc2d1d..824f41eeb 100644 --- a/lib/API/Extra.js +++ b/lib/API/Extra.js @@ -700,7 +700,7 @@ module.exports = function(CLI) { that.Client.executeRemote('getMonitorData', {}, function(err, list) { if (err) { console.error('Error retrieving process list: ' + err); - that.exitCli(conf.ERROR_EXIT); + that.exitCli(cst.ERROR_EXIT); } Monit.refresh(list); diff --git a/lib/completion.js b/lib/completion.js index 2bdf6202a..4799f907e 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -160,7 +160,7 @@ function install(name, completer, cb) { function next() { if(!rc || !scriptOutput) return; - writeRc(rc + scriptOutput, function(err) { + writeRc(completer, rc + scriptOutput, function(err) { if(err) return cb(err); return cb(null, ' ✓ ' + completer + ' tab-completion installed.'); }); @@ -180,7 +180,7 @@ function uninstall(name, completer, cb) { } part = markerIn + part.split(markerOut)[0] + markerOut; - writeRc(file.replace(part, ''), function(err) { + writeRc(completer, file.replace(part, ''), function(err) { if(err) return cb(err); return cb(null, ' ✓ ' + completer + ' tab-completion uninstalled.'); }); @@ -196,7 +196,7 @@ function readRc(completer, cb) { }); } -function writeRc(content, cb) { +function writeRc(completer, content, cb) { var file = '.' + process.env.SHELL.match(/\/bin\/(\w+)/)[1] + 'rc', filepath = pth.join(process.env.HOME, file); fs.lstat(filepath, function (err, stats) {