diff options
author | Mark J. Titorenko <mark@titorenko.net> | 2011-10-04 23:27:29 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-10-05 01:25:39 +0200 |
commit | 26a62a6552b19332f23cc4af87d74ae3ee4aa123 (patch) | |
tree | 246c2830d60f7bf2863acad45462c2853fafa78e /actionpack/lib/sprockets | |
parent | 42eda8f8a19e30e9d5de4e8963df1ee6ed8ce5a1 (diff) | |
download | rails-26a62a6552b19332f23cc4af87d74ae3ee4aa123.tar.gz rails-26a62a6552b19332f23cc4af87d74ae3ee4aa123.tar.bz2 rails-26a62a6552b19332f23cc4af87d74ae3ee4aa123.zip |
only reinvoke if necessary
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/sprockets')
-rw-r--r-- | actionpack/lib/sprockets/assets.rake | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index 68d9a9ca31..15cba0c475 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -11,7 +11,14 @@ namespace :assets do desc "Compile all the assets named in config.assets.precompile" task :precompile do - ruby_rake_task "assets:precompile:all" + if ENV['RAILS_GROUPS'].to_s.empty? || ENV['RAILS_ENV'].to_s.empty? + # We are currently running with no explicit bundler group + # and/or no explicit environment - we have to reinvoke rake to + # execute this task. + ruby_rake_task "assets:precompile:all" + else + Rake::Task["assets:precompile:all"].invoke + end end namespace :precompile do @@ -58,7 +65,14 @@ namespace :assets do desc "Remove compiled assets" task :clean do - ruby_rake_task "assets:clean:all" + if ENV['RAILS_GROUPS'].to_s.empty? || ENV['RAILS_ENV'].to_s.empty? + # We are currently running with no explicit bundler group + # and/or no explicit environment - we have to reinvoke rake to + # execute this task. + ruby_rake_task "assets:clean:all" + else + Rake::Task["assets:clean:all"].invoke + end end namespace :clean do |