Browse Source

Changed exec to execSync; moved error console messages to only output when errs

tags/v0.2.0
Muthu Kumar 7 years ago
parent
commit
65f0a87972
  1. 14
      util/nginxReload.js

14
util/nginxReload.js

@ -1,14 +1,14 @@
var { exec } = require('child_process');
var { execSync } = require('child_process');
function nginxReload() {
exec('service nginx reload', (error, stdout, stderr) => {
if (error) {
execSync('service nginx reload', function (error, stdout, stderr) {
if (error) {
console.error(`exec error: ${error}`);
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
});
}
})
}
module.exports = nginxReload;
Loading…
Cancel
Save