From 0f59c3a09e99468b555052f29d482f9cbb197b57 Mon Sep 17 00:00:00 2001 From: Jon Ruskin Date: Fri, 23 Mar 2018 08:43:51 -0700 Subject: [PATCH] prettier logging for rake setup --- Rakefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 0da0bde..0c542bf 100644 --- a/Rakefile +++ b/Rakefile @@ -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|