Skip to content

Commit

Permalink
! Only enhance rake task assets:precompile if it's defined
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Oct 19, 2018
1 parent 8bc2659 commit e1eb1a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tasks/asset_sync.rake
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ if Rake::Task.task_defined?("assets:precompile:nondigest")
# will get executed before yaml or Rails initializers.
Rake::Task["assets:sync"].invoke if defined?(AssetSync) && AssetSync.config.run_on_precompile
end
else
elsif Rake::Task.task_defined?("assets:precompile")
Rake::Task["assets:precompile"].enhance do
# rails 3.1.1 will clear out Rails.application.config if the env vars
# RAILS_GROUP and RAILS_ENV are not defined. We need to reload the
# assets environment in this case.
# Rake::Task["assets:environment"].invoke if Rake::Task.task_defined?("assets:environment")
Rake::Task["assets:sync"].invoke if defined?(AssetSync) && AssetSync.config.run_on_precompile
end
else
# Nothing to be enhanced
end

1 comment on commit e1eb1a1

@PikachuEXE
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit should fix #372

Please sign in to comment.