Closed rduque1 closed 5 years ago
I can confirm this behavior... honestly it's pretty dangerous running cli commands in a different place than the user expects them to end up...
Let me give some useful feedback - the fix here is probably altering:
https://github.com/Unitech/pm2-deploy/blob/master/deploy#L124
I think $shell $@
here is just always wrong. I'm not a sh
guy really but from what I can gather:
$shell "$*"
is correct here
will be fixed on next pm2 release
When I run:
pm2 deploy process.json staging exec "hostname && pwd"
orpm2 deploy process.json staging exec "hostname ; pwd"
the second command after the&&
or;
is executed on my local machine instead of the remote host.If I escape the ampersand
\&\&
or the\;
it works. But this is very counter intuitive as the command is between double quotes. It also work when the command is like "'\<commnad>'" or "\"\<command>\""