Use dokku_log_fail in all cases where there is an exit 1

This commit is contained in:
Jose Diaz-Gonzalez
2015-09-04 00:17:45 -04:00
parent 76cf4d2969
commit 95161a2a9f
9 changed files with 37 additions and 42 deletions

View File

@@ -50,14 +50,12 @@ case "$1" in
tar xf $INPUT_FILE --directory=$BACKUP_TMP_DIR
if [[ ! -f $BACKUP_TMP_DIR/.dokku_backup_version ]]; then
echo "Unable to determine backup version"
exit 1
dokku_log_fail "Unable to determine backup version"
fi
VERSION=$(< $BACKUP_TMP_DIR/.dokku_backup_version)
if [[ $VERSION -ne 1 ]]; then
echo "Unknown format version $VERSION"
exit 1
dokku_log_fail "Unknown format version $VERSION"
fi
echo "Importing a version $VERSION backup..."
@@ -69,8 +67,7 @@ case "$1" in
if $force; then
echo "-f used. Ignoring warnings."
else
echo "Archive did not pass sanity checks. Use -f to import anyway" >&2
exit 1
dokku_log_fail "Archive did not pass sanity checks. Use -f to import anyway"
fi
fi