hypercore-protocol / hyperdrive-daemon

Hyperdrive, batteries included.
MIT License
156 stars 23 forks source link

Work around an edge-case in pm2 start() #39

Closed pfrazee closed 4 years ago

pfrazee commented 4 years ago

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#L659

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 -c correctly with our own call if not windows.

andrewosh commented 4 years ago

Published in 1.9.2