Commit 45b8fb0a by ibaker Committed by microkatz

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
parent d8eec163
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
set -eu
FFMPEG_MODULE_PATH=$1 FFMPEG_MODULE_PATH=$1
NDK_PATH=$2 NDK_PATH=$2
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
# limitations under the License. # limitations under the License.
# #
set -e set -eu
ASM_CONVERTER="./libopus/celt/arm/arm2gnu.pl" ASM_CONVERTER="./libopus/celt/arm/arm2gnu.pl"
if [[ ! -x "${ASM_CONVERTER}" ]]; then if [[ ! -x "${ASM_CONVERTER}" ]]; then
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# a bash script that generates the necessary config files for libvpx android ndk # a bash script that generates the necessary config files for libvpx android ndk
# builds. # builds.
set -e set -eu
if [ $# -ne 0 ]; then if [ $# -ne 0 ]; then
echo "Usage: ${0}" echo "Usage: ${0}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment