Problem: Need a non rescue way to handle of success/failure.
Solution: Add fluent methods to then and catch
sh(meta: true) do
make!("build").then do |result|
puts "[✓] make build completed in {result.meta.timestamp}s"
end.catch do
puts "[✗] make build failed"
end.exec
# Another way
when_finish = proc { puts "Success" }
when_fail = proc { puts "Failed" }
make("build", _then: when_finish, _catch: when_fail)
end
Problem: Need a non rescue way to handle of success/failure.
Solution: Add fluent methods to then and catch