install & update
This commit is contained in:
commit
2cd52b492a
7 changed files with 100 additions and 56 deletions
25
lib/color.rb
Normal file
25
lib/color.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
module Color
|
||||
def colorize(text, color_code)
|
||||
"\033[#{color_code}#{text}\033[0m"
|
||||
end
|
||||
|
||||
def red(text)
|
||||
colorize(text, "31m")
|
||||
end
|
||||
|
||||
def green(text)
|
||||
colorize(text, "32m")
|
||||
end
|
||||
|
||||
def command(string)
|
||||
`#{string}`
|
||||
if $?.to_i > 0
|
||||
puts red " == #{string} - FAIL"
|
||||
puts red " == Error during configure"
|
||||
exit
|
||||
else
|
||||
puts green " == #{string} - OK"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue