lib/makit/command_runner.rb in makit-0.0.16 vs lib/makit/command_runner.rb in makit-0.0.19
- old
+ new
@@ -49,12 +49,15 @@
#cache_filename = Makit::Directories::PROJECT_ARTIFACTS + "/commands/#{command_request.name}.#{command_request.arguments.join("_")}.#{timestamp.seconds}.pb"
if File.exist?(cache_filename)
#puts "cache file date: #{File.mtime(cache_filename)}"
if (File.mtime(cache_filename) > timestamp)
- #puts "cache_filename exists and is newer than #{timestamp}"
+ puts " found cached command (newer than #{timestamp})".colorize(:grey)
command = Makit::Serializer.open(cache_filename, Makit::V1::Command)
show_command(command)
+ if command.exit_code != 0
+ abort "cached command failed: #{command.name} #{command.arguments.join(" ")}"
+ end
return command #Makit::Serializer.open(cache_filename, Makit::V1::Command)
else
#puts "cache_filename exists, but is older than #{timestamp}"
end
end