From 88a6bb1829655376a5c277d9f73c9196a77c0fa7 Mon Sep 17 00:00:00 2001 From: Muthu Kumar Date: Fri, 3 Nov 2017 04:50:36 +0530 Subject: [PATCH] Added nginxReload function --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 091a28f..3b54b0d 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,9 @@ var program = require('commander'); var shell = require('shelljs'); var fs = require('fs-extra'); var chalk = require('chalk'); +var bash = require('child_process.exec'); + +var nginxReload = bash("nginx -t && service reload nginx"); // Requiring utils var validate = require('./util/validate'); @@ -75,7 +78,7 @@ program.on('--help', function () { program.parse(process.argv); try { - exec("nginx -t && service reload nginx"); + nginxReload(); } catch (e) {