diff --git a/bin/forever-service b/bin/forever-service index 90dd9d7..6b1d2b8 100755 --- a/bin/forever-service +++ b/bin/forever-service @@ -207,11 +207,9 @@ function getForeverRoot(user){ function getCmdPath(cmd){ var r=shell.exec('whereis '+cmd, {silent: true}); - var re = new RegExp(cmd+":","g"); - if(r.output) { - var p = r.output.replace(re, "").trim(); - //console.log(cmd + 'path is ' + p); - return p; + var rs = r.output && r.output.split(" "); + if(rs && rs.length && rs.length > 1) { + return rs[1]; } else { console.log(cmd + 'path not found'); } diff --git a/package.json b/package.json index b1edc59..cb19535 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "forever-service", - "version": "0.5.3", + "version": "0.5.4", "preferGlobal": "true", "description": "Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS", "main": "lib/api.js",