因此,在我的 rake 命令中,当我执行 --trace 时,它只会在我手动执行的命令上执行,并且不会执行自定义 rake 执行的任何 rake 命令。
我的耙子命令:
namespace :db do
task :regenesis do
#because of how devestating this command could be, it's going
# to be forced to use the Test Environment
puts "Re-Generating the Database"
Rake::Task["db:drop RAILS_ENV=test --trace"].invoke
Rake::Task["db:create RAILS_ENV=test"].invoke
Rake::Task["db:create RAILS_ENV=test"].invoke
Rake::Task["db:bootstrap RAILS_ENV=test"].invoke
end
end
理想的情况是不必在其中硬编码 --trace =D
因此,我应该能够执行 rake db:regenesis --trace,并且它应该将跟踪附加到所有这些 rake 命令上。
我怎么做?