This creates a problem for some hyperdrive apps because they may have spaces in their install paths. (This is the case for Beaker.) The resulting call ends up being ${interpreter} /bin/bash -c ${script}, which is wrong. (To add a little more complexity, it does not do this on Windows because Windows has its own shell with its own resulting issues.)
This PR solves the issue by using /bin/bash -ccorrectly with our own call if not windows.
If 'pm2' detects a space in the 'script' path, it assumes the call is something like "python foo.py". When that's the case, it transforms the call into
/bin/bash -c python foo.py
. Relevant pm2 code: https://github.com/Unitech/pm2/blob/24c35236f555a638e1f4c803b57d7e0769261482/lib/Common.js#L659This creates a problem for some hyperdrive apps because they may have spaces in their install paths. (This is the case for Beaker.) The resulting call ends up being
${interpreter} /bin/bash -c ${script}
, which is wrong. (To add a little more complexity, it does not do this on Windows because Windows has its own shell with its own resulting issues.)This PR solves the issue by using
/bin/bash -c
correctly with our own call if not windows.