mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use rake tasks to set the default environment variables. fixes #2126
This commit is contained in:
parent
bb7e35531e
commit
5b6121aa34
1 changed files with 11 additions and 11 deletions
|
@ -1,16 +1,16 @@
|
||||||
namespace :assets do
|
namespace :assets do
|
||||||
desc "Compile all the assets named in config.assets.precompile"
|
# Ensures the RAILS_GROUPS environment variable is set
|
||||||
task :precompile do
|
task :ensure_env do
|
||||||
if ENV["RAILS_GROUPS"].to_s.empty?
|
ENV["RAILS_GROUPS"] ||= "assets"
|
||||||
ENV["RAILS_GROUPS"] = "assets"
|
end
|
||||||
Kernel.exec $0, *ARGV
|
|
||||||
else
|
|
||||||
Rake::Task["environment"].invoke
|
|
||||||
Sprockets::Helpers::RailsHelper
|
|
||||||
|
|
||||||
assets = Rails.application.config.assets.precompile
|
desc "Compile all the assets named in config.assets.precompile"
|
||||||
Rails.application.assets.precompile(*assets)
|
task :precompile => :ensure_env do
|
||||||
end
|
Rake::Task["environment"].invoke
|
||||||
|
Sprockets::Helpers::RailsHelper
|
||||||
|
|
||||||
|
assets = Rails.application.config.assets.precompile
|
||||||
|
Rails.application.assets.precompile(*assets)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Remove compiled assets"
|
desc "Remove compiled assets"
|
||||||
|
|
Loading…
Reference in a new issue