Created
August 5, 2009 02:34
-
-
Save defunkt/162448 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
## | |
# Returns the command that will check out +revision+ from the | |
# repository into directory +destination+. +revision+ can be any | |
# SHA1 or equivalent (e.g. branch, tag, etc...) | |
def checkout(revision, destination) | |
destination = File.join(destination, 'repo') | |
revision = 'HEAD' if revision =~ /head/i | |
[ "rm -rf #{destination}", | |
"#{git_cmd} clone #{repository} #{destination}", | |
"cd #{destination}", | |
"#{git_cmd} checkout -f -b deployed-#{revision} #{revision}", | |
"cd -" | |
].join(" && ") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment