Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# A hacky way to put files in Capistrano with sudoer permissions
def sudo_put(data, target)
tmp = "#{shared_path}/~tmp-#{rand(9999999)}"
put data, tmp
on_rollback { run "rm #{tmp}" }
sudo "cp -f #{tmp} #{target} && rm #{tmp}"

This comment has been minimized.

Copy link

grosser commented Apr 9, 2011

exactly what i needed, thanks ! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.