helm/rake/lib/git.rb

13 lines
258 B
Ruby
Raw Normal View History

2014-04-11 00:31:44 -07:00
include Rake::DSL
2014-09-05 14:01:52 -07:00
def git(url, dest)
unless Dir.exists?("#{dest}/.git")
rm_rf dest if Dir.exists?(dest)
sh "git clone '#{url}' '#{dest}'"
end
2014-04-11 00:31:44 -07:00
end
2014-09-05 14:01:52 -07:00
def github(repo, dest, protocol = "https")
git "#{protocol}://github.com/#{repo}.git", dest
2014-04-11 00:31:44 -07:00
end