mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
format.sh: support looping until it is happy
This commit is contained in:
parent
b4bea57667
commit
90db903e47
1 changed files with 8 additions and 3 deletions
|
@ -1,11 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if ! type -p pre-commit &>/dev/null; then
|
||||
echo "format.sh: pre-commit not found. Please use \`nix develop\`.";
|
||||
echo "format.sh: pre-commit not found. Please use \`nix develop -c ./maintainers/format.sh\`.";
|
||||
exit 1;
|
||||
fi;
|
||||
if test -z "$_NIX_PRE_COMMIT_HOOKS_CONFIG"; then
|
||||
echo "format.sh: _NIX_PRE_COMMIT_HOOKS_CONFIG not set. Please use \`nix develop\`.";
|
||||
echo "format.sh: _NIX_PRE_COMMIT_HOOKS_CONFIG not set. Please use \`nix develop -c ./maintainers/format.sh\`.";
|
||||
exit 1;
|
||||
fi;
|
||||
pre-commit run --config "$_NIX_PRE_COMMIT_HOOKS_CONFIG" --all-files
|
||||
|
||||
while ! pre-commit run --config "$_NIX_PRE_COMMIT_HOOKS_CONFIG" --all-files; do
|
||||
if [ "${1:-}" != "--until-stable" ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue