Created
November 16, 2009 06:56
-
-
Save bradgessler/235819 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
exactly what i needed, thanks ! :D