From 6753d076a42cad9b3afd0b7b3748c5bbe84e2cc2 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Fri, 12 Jan 2018 14:19:52 -0800 Subject: [PATCH] Minor improvements --- templates/bin/node/watch/cli-custom.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/bin/node/watch/cli-custom.js b/templates/bin/node/watch/cli-custom.js index 61d719d30..0f62275f2 100644 --- a/templates/bin/node/watch/cli-custom.js +++ b/templates/bin/node/watch/cli-custom.js @@ -81,16 +81,18 @@ for(i = 0; i < dirLen; i++) { } if(wait) return - try { - if(exitShell && shell != null) { + if(exitShell && shell != null) { + try { var isWin = /^win/.test(process.platform); if(!isWin) { - shell.kill (); + shell.kill('SIGKILL'); } else { cp.exec('taskkill /PID ' + shell.pid + ' /T /F', function(error, stdout, stderr) { }); } - } + } catch (e) {} + } + try { shell = execshell(command) } catch (e) { console.error (e);