I have a Rake task which looks something like the following. What I’m trying to do run a system command, and return its error-value. Before returning I’d like to display a message saying something like “[OK]” or “[FAILED]".
With this code, Rake returns success every time.
How do I get the Rake task to return the correct error value?
task :build do
status = system BUILD_SHELL_COMMAND
puts status ? "[OK]" : "[FAILED]"
status
end