You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to pass parameters to task prerequisite #292
task :my_before_hook, [:name] => :environment do |_t, args|
puts "Rake task #{args[:name]} started"
end
task :my_after_hook, [:name] => :environment do |_t, args|
puts "Rake task #{args[:name]} finished"
end
task :my_test_task => :environment do
puts '--------- This is test task'
end
Rake.application.tasks.each do |tsk|
next if [Rake::Task['my_before_hook'],
Rake::Task['my_after_hook']].include?(tsk)
tsk.enhance ['my_before_hook'] # I can't send any params with such code
tsk.enhance do
Rake::Task['my_after_hook'].invoke(tsk.name)
end
end
Activity
kenzan100 commentedon Mar 7, 2024
Hi! Has anybody found a way to do this?