Skip to content

Commit 362ccb6

Browse files
committed
handle errors in the handler xD
1 parent be55f7b commit 362ccb6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

deploy.sh

+5
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ handle_error() {
113113
local cmd="$1"
114114
local exit_code="$2"
115115
echo "Error: $cmd command failed with exit code $exit_code"
116+
cd "$GITPATH" || {
117+
echo "Error: Unable to change directory to $GITPATH"
118+
exit 1
119+
}
120+
git checkout "$CURRENTBRANCH"
116121
exit 1
117122
}
118123

0 commit comments

Comments
 (0)