0

I would like to return from a rake task in the calling task. Does it possible?

Something like in this example, i would like to be able to call task one and one independantly but also one and two sequentially.

task: one
   do some work
   if work ok
      task.return true
   else
      puts "task one ko"
      task.return false
   end
end

task: two
   do some work
   if work ok
      task.return true
   else
      puts "task two ko"
      task.return false
   end
end

task: all
  Rake::Task["one"].invoke 
  Rake::Task["two"].invoke
end

I am not able to return in the "all" task. And "return" and abort("message") quit the script.

7vingt
  • 301
  • 2
  • 16

1 Answers1

0

Solution : tasks are lambda blocks that's why we have to use "next" instead "return".

7vingt
  • 301
  • 2
  • 16