lib/alpha_omega/deploy.rb in alpha_omega-0.0.65 vs lib/alpha_omega/deploy.rb in alpha_omega-0.0.66

- old
+ new

@@ -269,19 +269,19 @@ DESC task :symlink, :except => { :no_release => true } do if releases.length > 0 on_rollback do if previous_release - run "ln -vsnf #{previous_release} #{current_path}; true" + run "#{File.dirname(current_path).index(deploy_to) == 0 ? "" : try_sudo} ln -vsnf #{previous_release} #{current_path}; true" else logger.important "no previous release to rollback to, rollback of symlink skipped" end end if releases.length == 1 run "[[ $(readlink #{current_path} 2>&-) = #{latest_release} ]] || #{try_sudo} ln -vsnf #{latest_release} #{current_path}" else - run "ln -vsnf #{latest_release} #{current_path}" + run "#{File.dirname(current_path).index(deploy_to) == 0 ? "" : try_sudo} ln -vsnf #{latest_release} #{current_path}" end system "#{figlet} -w 200 #{release_name} activated" end end