2

By default Rake will stop at the first exception raised.

There doesn't seem to be a command line equivalent to make -k, is there any way to do it programmaticaly?

1
  • Solved my problem in a similar way suggested by @jmonteiro: rule '.o' => ['.c'] do |t| begin sh "cc #{t.source} -c -o #{t.name}" rescue RuntimeError => e if keep_going? next 0 else raise e end end end
    – hausen
    Feb 23, 2012 at 16:07

1 Answer 1

1

Unfortunately there is no --keep-going in rake (and I think that's fine). The only way I can think of is to wrap your Rakefile with begin; rescue; end, but it won't make it "keep going" -- it will simply ensure that your rake's execution return is 0.

begin
  # Former Rakefile code goes here
rescue
  puts $!.inspect
end

I believe that "keep going" isn't possible since when you raise something you already changed your algorithm's flow -- i.e. don't try to solve your problem by ignoring Exceptions.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.