This is already handled from bootstrap at
a1ca449981/src/bootstrap/src/utils/helpers.rs (L504-L506).
Signed-off-by: onur-ozkan <work@onurozkan.dev>
19 lines
428 B
Bash
Executable file
19 lines
428 B
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# Call `tidy` before git push
|
|
# Copy this script to .git/hooks to activate,
|
|
# and remove it from .git/hooks to deactivate.
|
|
#
|
|
|
|
set -Euo pipefail
|
|
|
|
ROOT_DIR="$(git rev-parse --show-toplevel)"
|
|
|
|
echo "Running pre-push script $ROOT_DIR/x test tidy"
|
|
|
|
cd "$ROOT_DIR"
|
|
./x test tidy --set build.locked-deps=true
|
|
if [ $? -ne 0 ]; then
|
|
echo "You may use \`git push --no-verify\` to skip this check."
|
|
exit 1
|
|
fi
|