From 8cd66cf6904fef8ccebba2cf0d5b76f1962e5c9b Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 4 Oct 2017 21:19:45 +0200 Subject: [PATCH] Add error handling: exit if cd fails --- contrib/tidy_datadir.sh | 2 +- share/genbuild.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/tidy_datadir.sh b/contrib/tidy_datadir.sh index 5d6d82644..0d614e1c9 100755 --- a/contrib/tidy_datadir.sh +++ b/contrib/tidy_datadir.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ -d "$1" ]; then - cd "$1" + cd "$1" || exit 1 else echo "Usage: $0 " >&2 echo "Removes obsolete Bitcoin database files" >&2 diff --git a/share/genbuild.sh b/share/genbuild.sh index 895ce3792..6d35faa97 100755 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -7,7 +7,7 @@ export LC_ALL=C if [ $# -gt 1 ]; then - cd "$2" + cd "$2" || exit 1 fi if [ $# -gt 0 ]; then FILE="$1"