Reformatting rake libs
This commit is contained in:
parent
faa745c384
commit
889a15ad70
|
@ -1,9 +1,12 @@
|
|||
include Rake::DSL
|
||||
|
||||
def git(url, dest)
|
||||
sh "git clone #{url} #{dest}" unless Dir.exists?(dest)
|
||||
unless Dir.exists?("#{dest}/.git")
|
||||
rm_rf dest if Dir.exists?(dest)
|
||||
sh "git clone '#{url}' '#{dest}'"
|
||||
end
|
||||
end
|
||||
|
||||
def github(repo,dest)
|
||||
git "https://github.com/#{repo}.git", dest
|
||||
def github(repo, dest, protocol = "https")
|
||||
git "#{protocol}://github.com/#{repo}.git", dest
|
||||
end
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
def echo(msg)
|
||||
def echo(msg, level = 1)
|
||||
# print green text
|
||||
puts "\e[32m=> #{msg}\e[0m"
|
||||
puts "\e[32m#{"="*level}> #{msg}\e[0m"
|
||||
end
|
||||
|
||||
def echoerr(msg)
|
||||
def error(msg)
|
||||
# print red text
|
||||
puts "\e[31m=> #{msg}\e[0m"
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ def sh_safe(cmd)
|
|||
begin
|
||||
return sh(cmd)
|
||||
rescue
|
||||
echoerr $!
|
||||
error $!
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue