Skip to content

Commit 1e44ae0

Browse files
Add error handling: exit if cd fails
1 parent b9e79ab commit 1e44ae0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

contrib/tidy_datadir.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

66
if [ -d "$1" ]; then
7-
cd "$1"
7+
cd "$1" || exit 1
88
else
99
echo "Usage: $0 <datadir>" >&2
1010
echo "Removes obsolete Bitcoin database files" >&2

contrib/verifybinaries/verify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if [ ! -d "$WORKINGDIR" ]; then
3333
mkdir "$WORKINGDIR"
3434
fi
3535

36-
cd "$WORKINGDIR"
36+
cd "$WORKINGDIR" || exit 1
3737

3838
#test if a version number has been passed as an argument
3939
if [ -n "$1" ]; then

share/genbuild.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

66
if [ $# -gt 1 ]; then
7-
cd "$2"
7+
cd "$2" || exit 1
88
fi
99
if [ $# -gt 0 ]; then
1010
FILE="$1"

0 commit comments

Comments
 (0)