bin/probe in utils-0.0.85 vs bin/probe in utils-0.0.86
- old
+ new
@@ -27,11 +27,11 @@
exit 1
end
def cmd(*args)
puts args * ' '
- system(*args)
+ system(*args) or exit $?.exitstatus
end
def find_cmd(*cmds)
cmds.map { |c| `which #{c}`.full?(:chomp) }.compact.first or
raise fail "no #{cmds * '|'} command found"
@@ -72,15 +72,25 @@
STDOUT.puts msg
STDOUT.flush
end
def run_job(job)
- output_message "Job #{job.inspect} about to run now:".black.on_yellow
+ message = "Job #{job.inspect} about to run now:".black
+ message = message.ask_and_send(:on_color, 166) || message.on_yellow
+ output_message message
fork do
exec(*cmd(job))
end
Process.wait
- output_message "Job #{job.inspect} was just run.".black.on_red
+ message = "Job #{job.inspect} was just run"
+ if $?.success?
+ message << " successfully."
+ message = message.black.on_green
+ else
+ message << " and failed with exit status #{$?.exitstatus}!"
+ message = message.white.on_red.blink
+ end
+ output_message message
end
def work_loop
loop do
job = @jobs.shift