tooling: Enable strict shell mode in selected scripts.

Add strict shell options (set -euo pipefail / set -eu) to a small
set of simple shell scripts that do not rely on unset variables
or pipeline exit-code masking.

Each script was reviewed line by line to confirm strict mode is
safe and that stopping immediately on errors is the correct
behavior for these scripts.

Fixes part of #20748.
This commit is contained in:
Arun Kushwaha 2026-01-21 23:23:52 +05:30 committed by GitHub
parent 279c72de3a
commit 19e9a4e44b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
symlink_with_backup() {
if [ -e "$2" ]; then
# If the user is setting up our automatic certbot-management on a

View File

@ -1,3 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
service nginx reload

View File

@ -1,3 +1,4 @@
#!/bin/sh
set -eu
ZULIP_PATH="$(dirname "$0")/.."
exec "$ZULIP_PATH/node_modules/.bin/tsc" --project "$ZULIP_PATH" "$@"

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
if ! [ -d ".git/hooks/" ]; then
echo "Error: Could not find .git/hooks directory"