This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#from https://gist.github.com/dvishniakov/86c83ef891d200674522c791589d42b3 | |
# Provides stack trace when error occurs or when manually called | |
# $1 is message | |
# $2 is command | |
# ${ContinueOnErrors} controls whether to continue or stop script if error is catched. | |
# it helps during batch processing. -o errexit/errtrace also affects this | |
errexit() { | |
local errno=$? # non-zero when this function is called via trap |