lib/pah/files/lib/tasks/integration.rake in pah-0.0.3 vs lib/pah/files/lib/tasks/integration.rake in pah-0.0.4

- old
+ new

@@ -1,29 +1,29 @@ # -*- encoding : utf-8 -*- namespace :integration do - APP = 'PROJECT' + APP = ENV['APP'] namespace :heroku do task :add_remote do remote = `git remote |grep heroku` sh "git remote add heroku git@heroku.com:#{APP}.git" if remote.strip.blank? end task :check do - var = `heroku config -s --app #{APP}|grep INTEGRATING_BY` + var = Bundler.with_clean_env { `heroku config -s --app #{APP}|grep INTEGRATING_BY` } integrating_by = var.split('=')[1] # Eu sei que é tosco, mas foda-se user = `whoami` if !integrating_by.blank? and integrating_by != user p80 "Project is already being integrated by #{integrating_by}" exit end end task :lock do user = `whoami` - sh "heroku config:add INTEGRATING_BY=#{user}" + Bundler.with_clean_env { sh "heroku config:add INTEGRATING_BY=#{user}" } end task :unlock do - `heroku config:remove INTEGRATING_BY` + Bundler.with_clean_env { sh "heroku config:remove INTEGRATING_BY" } end end end INTEGRATION_TASKS = %w(