zulip/tools/setup-git-repo
Arun Kushwaha 19e9a4e44b
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.
2026-01-21 09:53:52 -08:00

13 lines
305 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
if ! [ -d ".git/hooks/" ]; then
echo "Error: Could not find .git/hooks directory"
echo "Please re-run this script from the root of your zulip.git checkout"
exit 1
fi
for hook in pre-commit commit-msg; do
ln -snf ../../tools/"$hook" .git/hooks/
done