Skip to content

Commit

Permalink
Add try.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
2JS committed Feb 4, 2024
1 parent d7946d7 commit 8e33383
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions try.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#/bin/sh
function try() {
echo "\033[96;1m::debug '$@'\033[0m"
eval "$@"
if [ $? -ne 0 ]; then
echo "\033[31;1m::error '$@' failed.\033[0m"
exit 1
fi
echo "\033[32;1m::debug '$@' succeed.\033[0m"
}

0 comments on commit 8e33383

Please sign in to comment.