Here is the current way I run rak dependent tasks
task :test => [:prepare_testdir,:run_tests]
currently there is no parameters for these two dependent tasks. But I need to add parameters to one of tasks. It should be running like on command line
rake prepare_testdir[mydir]
How do I pass this new parameter to this
task :test => [:prepare_testdir,:run_tests]
I have tried
task :test => [:prepare_testdir[mydir],:run_tests]
and
task :test => [:prepare_testdir['mydir'],:run_tests]
both are not working.
Thanks in advance
Inside the rake file
task :test, [:dir] => [:prepare_testdir] do |t,args|
puts args.inspect # {:dir=>"foo"}
end
task :prepare_testdir, :dir do |t, args|
puts args.inspect # {:dir=>"foo"}
end
Invocation
rake test[foo]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With