1
0
Fork 0
mirror of https://github.com/cisagov/log4j-affected-db.git synced 2024-11-22 16:40:48 +00:00

Add the beautysh pre-commit hook

This hook performs auto-formatting (beautifying) of Bash scripts.
This commit is contained in:
Nicholas McDonnell 2021-01-15 10:34:34 -05:00
parent 09f4f549a8
commit ecdfc527d4
No known key found for this signature in database
GPG key ID: 7994ADE2A56BE5D1
2 changed files with 14 additions and 7 deletions

View file

@ -48,6 +48,13 @@ repos:
- --strict
# Shell script hooks
- repo: https://github.com/lovesegfault/beautysh
rev: 6.0.1
hooks:
- id: beautysh
args:
- --indent-size
- '2'
- repo: https://github.com/detailyang/pre-commit-shell
rev: 1.0.5
hooks:

View file

@ -50,14 +50,14 @@ while (( "$#" )); do
shift
;;
-*) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
PARAMS="$PARAMS $1"
shift
;;
esac
done
# set positional arguments in their proper place