diff options
author | Aaron LI <aly@aaronly.me> | 2018-03-10 19:35:49 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-03-10 19:35:49 +0800 |
commit | 97e0ab7de5f92b375715cc5c3e082fccdb809b13 (patch) | |
tree | 33b3a43510c9500e2a3c68ba7bbfff10b0ed2ad9 | |
parent | 35de7250a5d361dff1a8d94403fe106d0ea34e4c (diff) | |
download | dfly-update-97e0ab7de5f92b375715cc5c3e082fccdb809b13.tar.bz2 |
Add DEBUG var, debug() and warn() functions
-rwxr-xr-x | dfly-update | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dfly-update b/dfly-update index 33f2cbf..c76d45e 100755 --- a/dfly-update +++ b/dfly-update @@ -9,6 +9,8 @@ set -e +DEBUG=${DEBUG:-""} + NAME="dfly-update" VERSION="0.?.?" TOOLDIR="${0%/*}" @@ -41,6 +43,14 @@ UPDATE_BRANCH= # Helper Functions # +debug() { + [ -n "${DEBUG}" ] && echo "DEBUG: $@" >&2 +} + +warn() { + echo "WARNING: $@" >&2 +} + error() { echo "ERROR: $@" >&2 } |