mirror of
https://github.com/zulip/zulip.git
synced 2026-06-06 21:12:33 +08:00
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.
13 lines
305 B
Bash
Executable File
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
|