Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invoke rake task with arguments from another task

Tags:

I would like to be able to pass arguments for a task that I have to call from another task

Invoking without arguments works for me like this:

Rake::Task["mytask1"].invoke 

However with arguments like this it does not:

Rake::Task["mytask1[1,v18_0,20141230]"].invoke 

Thanks

like image 613
Karim Mtl Avatar asked Aug 06 '15 14:08

Karim Mtl


1 Answers

you can try

Rake::Task[:my_task].invoke(1,'v18_0',20141230) 

or you can do

Rake.application.invoke_task("my_task[1, 'v18_0', 20141230]") 
like image 66
Rajarshi Das Avatar answered Oct 09 '22 05:10

Rajarshi Das