Browse Source

fix(makefile): create .git/hooks if needed (#20054)

Bruno Garcia 4 years ago
parent
commit
7716833766
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Makefile

+ 1 - 1
Makefile

@@ -64,7 +64,7 @@ setup-git-config:
 
 
 setup-git: ensure-venv setup-git-config
 setup-git: ensure-venv setup-git-config
 	@echo "--> Installing git hooks"
 	@echo "--> Installing git hooks"
-	cd .git/hooks && ln -sf ../../config/hooks/* ./
+	mkdir -p .git/hooks && cd .git/hooks && ln -sf ../../config/hooks/* ./
 	@PYENV_VERSION=$(REQUIRED_PY3_VERSION) python3 -c '' || (echo 'Please run `make setup-pyenv` to install the required Python 3 version.'; exit 1)
 	@PYENV_VERSION=$(REQUIRED_PY3_VERSION) python3 -c '' || (echo 'Please run `make setup-pyenv` to install the required Python 3 version.'; exit 1)
 	$(PIP) install "pre-commit==1.18.2" "virtualenv==20.0.23"
 	$(PIP) install "pre-commit==1.18.2" "virtualenv==20.0.23"
 	@PYENV_VERSION=$(REQUIRED_PY3_VERSION) pre-commit install --install-hooks
 	@PYENV_VERSION=$(REQUIRED_PY3_VERSION) pre-commit install --install-hooks