lib/negroku/tasks/rbenv.rake in negroku-2.0.1 vs lib/negroku/tasks/rbenv.rake in negroku-2.0.2

- old
+ new

@@ -33,11 +33,11 @@ end end end desc "Add environmental variables in the form VAR=value" - task :add, [:variable] => 'deploy:check:linked_files' do |t, args| + task :add, [:variable] => 'deploy:check:directories' do |t, args| vars = [args.variable] + args.extras on release_roles :app do within shared_path do @@ -45,32 +45,37 @@ key, value = var.split('=') cmd = build_add_var_cmd("#{shared_path}/.rbenv-vars", key, value) execute cmd end end + + if test "[ -d #{current_path} ]" + invoke 'env:changed' + end end end desc "Remove environmental variable" task :remove, [:key] do |t, args| on release_roles :app do within shared_path do execute :sed, "-i", "/^#{args[:key]}=/d", ".rbenv-vars" end + + if test "[ -d #{current_path} ]" + invoke 'env:changed' + end end end # Ensure the rbenv-vars file exist - before 'deploy:check:linked_files', 'deploy:check:files' do + after 'deploy:check:directories', 'check:files' do on release_roles fetch(:rbenv_roles) do within shared_path do execute :touch, ".rbenv-vars" end end end - - after 'rbenv:vars:add', 'env:changed' - after 'rbenv:vars:remove', 'env:changed' end end