Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

only reinvoke if necessary

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 26a62a6552b19332f23cc4af87d74ae3ee4aa123 1 parent 42eda8f
@mjtko mjtko authored josevalim committed
Showing with 16 additions and 2 deletions.
  1. +16 −2 actionpack/lib/sprockets/assets.rake
View
18 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
Please sign in to comment.
Something went wrong with that request. Please try again.