Skip to content

Commit

Permalink
let it be zsh redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapis committed Sep 21, 2011
1 parent c6e6c08 commit 6e703a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions shell/functions
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ do_deploy()
# Logging (http://nakedape.cc/wiki/ShellHacks 1.6.1, 1.7, 1.11)
export log_file="${deploy_log_path}/deploy.log"
touch "${log_file}"
exec 3>>"${log_file}"
exec &> >(tee -a "${log_file}")
#exec 3>>"${log_file}"
exec > >(tee -a "${log_file}") 2>&1
# Error handling
trap revert_on_error ERR
trap revert_on_error ZERR
Expand Down Expand Up @@ -356,7 +356,7 @@ deploy()
for _step in "${deploy_steps[@]}"
do
#step "${deploy_steps[@]}" >> "${deploy_log_path}/${_hook}" 2>&1
step "${_step}" 2>&3
step "${_step}" 2>>"${log_file}"
#step "${_step}" >> "${deploy_log_path}/${_step}" 2>&1
done
}
Expand All @@ -367,7 +367,7 @@ revert_on_error()
status=$?
trap "backtrace \"An errorr occured while reverting.\"" ERR
trap "backtrace \"An errorr occured while reverting.\"" ZERR
backtrace "A command has returned an not handled error code (${status})." no_exit 2>&3
backtrace "A command has returned an not handled error code (${status})." no_exit 2>"${log_file}"
log "\nAn error occured, reverting...\n for details check deploy.$timestamp.log\n" >&2
retreat >&2
kill -s USR2 $APP_PID #to exit application not current subshell
Expand Down

0 comments on commit 6e703a1

Please sign in to comment.