The pattern
run [ .. ].join(" && ")
is so widely used that perhaps it should be subsumed into rake-remote_task, i.e.
def run(*commands)
command = commands.join(" && ")
...
end
It would also be useful if sudo could take multiple commands this way. It would have to expand to
sudo foo && sudo bar # not: sudo foo && bar
It could be desirable to have
sudo sh -c 'foo && bar'
but that introduces problems with quoting. Maybe it could be done as
sudo sh <<EOF
foo && bar
EOF
as long as that doesn't introduce problems with prompting for sudo password.
|