Skip to content

Commit

Permalink
make restart prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
benmmurphy committed Mar 4, 2012
1 parent 7dd2536 commit da592fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ def put_file(contents, target)
end

task :restart, :roles => :app do
run "#{try_sudo :as => "root"} start #{application} || #{try_sudo :as => "root"} reload #{application}"
cmd = "STATUS=`#{try_sudo :as => 'root'} status #{application}`; echo Previous Status: $STATUS; RESULT=`#{try_sudo :as => 'root'} start #{application} 2>&1`; if [[ $? -eq 0 ]]; then echo $RESULT; else echo Reloading; #{try_sudo :as => 'root'} reload #{application}; fi"

run cmd, :shell => "/bin/bash"
end

task :npm_install, :roles => :app do
Expand Down

0 comments on commit da592fa

Please sign in to comment.