Browse Source

Add error handling: exit if cd fails

0.16
practicalswift 7 years ago
parent
commit
1e44ae0e19
  1. 2
      contrib/tidy_datadir.sh
  2. 2
      contrib/verifybinaries/verify.sh
  3. 2
      share/genbuild.sh

2
contrib/tidy_datadir.sh

@ -4,7 +4,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
if [ -d "$1" ]; then if [ -d "$1" ]; then
cd "$1" cd "$1" || exit 1
else else
echo "Usage: $0 <datadir>" >&2 echo "Usage: $0 <datadir>" >&2
echo "Removes obsolete Bitcoin database files" >&2 echo "Removes obsolete Bitcoin database files" >&2

2
contrib/verifybinaries/verify.sh

@ -33,7 +33,7 @@ if [ ! -d "$WORKINGDIR" ]; then
mkdir "$WORKINGDIR" mkdir "$WORKINGDIR"
fi fi
cd "$WORKINGDIR" cd "$WORKINGDIR" || exit 1
#test if a version number has been passed as an argument #test if a version number has been passed as an argument
if [ -n "$1" ]; then if [ -n "$1" ]; then

2
share/genbuild.sh

@ -4,7 +4,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php. # file COPYING or http://www.opensource.org/licenses/mit-license.php.
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then
cd "$2" cd "$2" || exit 1
fi fi
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
FILE="$1" FILE="$1"

Loading…
Cancel
Save