Add set -eu to all shell scripts

These flags ensure that any errors cause the script to exit (instead of
just carrying on) (`-e`) and that any unrecognised substitution variables
cause an error instead of silently resolving to an empty string (`-u`).

Issues like Issue: google/ExoPlayer#10791 should be more quickly resolved with
`set -e` because the script will clearly fail with an error like
`make: command not found` which would give the user a clear pointer
towards the cause of the problem.

#minor-release

PiperOrigin-RevId: 490001419
This commit is contained in:
ibaker 2022-11-21 17:34:53 +00:00 committed by microkatz
parent d8eec16369
commit 45b8fb0ae1
3 changed files with 3 additions and 2 deletions

View File

@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -eu
FFMPEG_MODULE_PATH=$1
NDK_PATH=$2

View File

@ -15,7 +15,7 @@
# limitations under the License.
#
set -e
set -eu
ASM_CONVERTER="./libopus/celt/arm/arm2gnu.pl"
if [[ ! -x "${ASM_CONVERTER}" ]]; then

View File

@ -18,7 +18,7 @@
# a bash script that generates the necessary config files for libvpx android ndk
# builds.
set -e
set -eu
if [ $# -ne 0 ]; then
echo "Usage: ${0}"