mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-19 13:34:01 +08:00
fix pre-commit install process (#31445)
* fix pre-commit install process * only install pre-commit from a git repo
This commit is contained in:
@@ -75,12 +75,8 @@ pyenv rehash
|
||||
|
||||
[ -n "$POETRY_VIRTUALENVS_CREATE" ] && RUN="" || RUN="poetry run"
|
||||
|
||||
if [ "$(uname)" != "Darwin" ]; then
|
||||
if [ "$(uname)" != "Darwin" ] && [ -e "$ROOT/.git" ]; then
|
||||
echo "pre-commit hooks install..."
|
||||
shopt -s nullglob
|
||||
for f in .pre-commit-config.yaml */.pre-commit-config.yaml; do
|
||||
if [ -e "$ROOT/$(dirname $f)/.git" ]; then
|
||||
$RUN pre-commit install -c "$f"
|
||||
fi
|
||||
done
|
||||
$RUN pre-commit install
|
||||
$RUN git submodule foreach pre-commit install
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user