aboutsummaryrefslogtreecommitdiffstats
path: root/dfly-update
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-11 11:08:58 +0800
committerAaron LI <aly@aaronly.me>2018-03-11 11:23:18 +0800
commit20c96d48222e89ab603521f1da8d79ba97679bbb (patch)
tree73849c698c26f89d4518054cc7b2c5ca8836791b /dfly-update
parent0550cac5c7348eca0b24e9d66f537089302d0ab3 (diff)
downloaddfly-update-20c96d48222e89ab603521f1da8d79ba97679bbb.tar.bz2
Document "set -e" and fix cmd_status() invocation in cmd_fly()
Diffstat (limited to 'dfly-update')
-rwxr-xr-xdfly-update5
1 files changed, 4 insertions, 1 deletions
diff --git a/dfly-update b/dfly-update
index 5f9d78e..6103bfa 100755
--- a/dfly-update
+++ b/dfly-update
@@ -7,6 +7,7 @@
# snapshot builds.
#
+# Exit immediately if any untested command fails in non-interactive mode
set -e
DEBUG=${DEBUG:-""}
@@ -90,6 +91,7 @@ _HAS_UPDATE=
#
debug() {
+ # Add "|| true" to work with "set -e"
[ -n "${DEBUG}" ] && echo "DEBUG: $@" >&2 || true
}
@@ -720,8 +722,9 @@ cmd_fly() {
[ $# -eq 0 ] || \
error ${EC_ARGS} "cmd_fly: invalid arguments: $@"
echo "Checking status ..."
- cmd_status
+ cmd_status || true
if [ ${_HAS_UPDATE} -eq 1 ]; then
+ # Need to update
local file="${CACHE_DIR}/${_FILENAME}"
cmd_download "${_FILENAME}" ${_MD5}
cmd_mount ${file}