From d15a12ceae8b0c9c27625180ae002178b0bfe5d0 Mon Sep 17 00:00:00 2001 From: vince Date: Thu, 5 Jul 2018 16:29:34 +0200 Subject: [PATCH] hotfix: fix #3767, do not consider as a command if space and slash are found --- lib/Common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Common.js b/lib/Common.js index 470c25833..8d3dacbb5 100644 --- a/lib/Common.js +++ b/lib/Common.js @@ -599,7 +599,8 @@ Common.verifyConfs = function(appConfs){ // If command is like pm2 start "python xx.py --ok" // Then automatically start the script with bash -c and set a name eq to command - if (app.script && app.script.indexOf(' ') > -1 && app.script.indexOf('/') === -1 && app.script.indexOf('\\') === -1) { + + if (app.script && app.script.indexOf(' ') > -1 && app.script === path.basename(app.script)) { var _script = app.script; if (require('shelljs').which('bash')) app.script = 'bash';