mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
Bash is currently a dependency of pre-commit. It is only used in the pre-commit script, and the only bash-specific feature that is used is a single array. Use the `args` array instead, which works on plain sh (e.g.: POSIX sh). This change drops bash as a runtime dependency. Tested with busybox sh(ash) and OpenBSD's sh(ksh).
21 lines
508 B
Bash
Executable file
21 lines
508 B
Bash
Executable file
#!/bin/sh
|
|
# File generated by pre-commit: https://pre-commit.com
|
|
# ID: 138fd403232d2ddd5efb44317e38bf03
|
|
|
|
# start templated
|
|
INSTALL_PYTHON=''
|
|
ARGS="hook-impl"
|
|
# end templated
|
|
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
set -- $ARGS --hook-dir "$HERE" -- "$@"
|
|
|
|
if [ -x "$INSTALL_PYTHON" ]; then
|
|
exec "$INSTALL_PYTHON" -mpre_commit "$@"
|
|
|
|
elif command -v pre-commit > /dev/null; then
|
|
exec pre-commit "$@"
|
|
else
|
|
echo '`pre-commit` not found. Did you forget to activate your virtualenv?' 1>&2
|
|
exit 1
|
|
fi
|