prettier logging for rake setup

This commit is contained in:
Jon Ruskin 2018-03-23 08:43:51 -07:00
Родитель 870473ebc6
Коммит 0f59c3a09e
1 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -4,7 +4,23 @@ require "rake/testtask"
desc "Run source setup scripts"
task :setup do
Dir["script/setup/*"].each { |script| system(script) }
Dir["script/setup/*"].each do |script|
# green
puts "\033[32mRunning #{script}.\e[0m"
if system(script)
# green
puts "\033[32mCompleted #{script}.\e[0m"
elsif $?.exitstatus == 127
# yellow
puts "\033[33mSkipped #{script}.\e[0m"
else
# red
puts "\033[31mEncountered an error running #{script}.\e[0m"
end
puts
end
end
Rake::TestTask.new(:test) do |t|