lib/figaro/tasks.rake in figaro-0.4.1 vs lib/figaro/tasks.rake in figaro-0.5.0
- old
+ new
@@ -1,9 +1,9 @@
namespace :figaro do
desc "Configure Heroku according to application.yml"
task :heroku, [:app] => :environment do |_, args|
- vars = Figaro.env.map{|k,v| "#{k}=#{v}" }.sort.join(" ")
- command = "heroku config:add #{vars}"
- command << " --app #{args[:app]}" if args[:app]
- Kernel.system(command)
+ app = args[:app] ? " --app #{args[:app]}" : ""
+ rails_env = Kernel.system("heroku config:get RAILS_ENV#{app}").presence
+ Rails.env = rails_env if rails_env
+ Kernel.system("heroku config:add #{Figaro.vars}#{app}")
end
end