diff options
| author | practicalswift <[email protected]> | 2017-10-04 21:19:45 +0200 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2017-10-18 17:09:36 +0200 |
| commit | 1e44ae0e198b0bc3c4363774a27a3e72a5c2a47b (patch) | |
| tree | dd31098a6ed363911b6384a11455dd8977e4d4ca | |
| parent | Remove "\n" from echo argument. echo does not support escape sequences. (diff) | |
| download | discoin-1e44ae0e198b0bc3c4363774a27a3e72a5c2a47b.tar.xz discoin-1e44ae0e198b0bc3c4363774a27a3e72a5c2a47b.zip | |
Add error handling: exit if cd fails
| -rwxr-xr-x | contrib/tidy_datadir.sh | 2 | ||||
| -rwxr-xr-x | contrib/verifybinaries/verify.sh | 2 | ||||
| -rwxr-xr-x | share/genbuild.sh | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/contrib/tidy_datadir.sh b/contrib/tidy_datadir.sh index 8960f8811..b845b34e4 100755 --- a/contrib/tidy_datadir.sh +++ b/contrib/tidy_datadir.sh @@ -4,7 +4,7 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. if [ -d "$1" ]; then - cd "$1" + cd "$1" || exit 1 else echo "Usage: $0 <datadir>" >&2 echo "Removes obsolete Bitcoin database files" >&2 diff --git a/contrib/verifybinaries/verify.sh b/contrib/verifybinaries/verify.sh index 320add64d..bf2a10337 100755 --- a/contrib/verifybinaries/verify.sh +++ b/contrib/verifybinaries/verify.sh @@ -33,7 +33,7 @@ if [ ! -d "$WORKINGDIR" ]; then mkdir "$WORKINGDIR" fi -cd "$WORKINGDIR" +cd "$WORKINGDIR" || exit 1 #test if a version number has been passed as an argument if [ -n "$1" ]; then diff --git a/share/genbuild.sh b/share/genbuild.sh index 32ef2a575..419e0da0f 100755 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -4,7 +4,7 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. if [ $# -gt 1 ]; then - cd "$2" + cd "$2" || exit 1 fi if [ $# -gt 0 ]; then FILE="$1" |