Enable "set -euo pipefail" in all bash scripts.

This enables "set -e", "set -u", and "set -o pipefail", which
catch common errors.
This commit is contained in:
Dan Gohman
2018-02-27 15:32:21 -08:00
parent 6a962e8b2c
commit d394ae0902
5 changed files with 6 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
# set -euo pipefail
# Usage: check-rustfmt.sh [--install] # Usage: check-rustfmt.sh [--install]
# #
# Check that the desired version of rustfmt is installed. # Check that the desired version of rustfmt is installed.

View File

@@ -1,10 +1,8 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
# Format all sources using rustfmt. # Format all sources using rustfmt.
# Exit immediately on errors.
set -e
cd $(dirname "$0") cd $(dirname "$0")
# Make sure we can find rustfmt. # Make sure we can find rustfmt.

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
set -e set -euo pipefail
cd $(dirname "$0") cd $(dirname "$0")
topdir=$(pwd) topdir=$(pwd)

View File

@@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
# This is the top-level test script: # This is the top-level test script:
# #
@@ -10,9 +11,6 @@
# #
# All tests run by this script should be passing at all times. # All tests run by this script should be passing at all times.
# Exit immediately on errors.
set -e
# Repository top-level directory. # Repository top-level directory.
cd $(dirname "$0") cd $(dirname "$0")
topdir=$(pwd) topdir=$(pwd)

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
set -e set -euo pipefail
cd $(dirname "$0") cd $(dirname "$0")
runif() { runif() {