Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4609

Rake task return value for Ruby system() call

$
0
0

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]"  statusend

Viewing all articles
Browse latest Browse all 4609

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>