Download git-hooks/pre-commit from Vishvam10/cloudenv: direct link, hf CLI and curl.
- Browser
- Download file 389 Bytes
-
https://huggingface.co/spaces/Vishvam10/cloudenv/resolve/main/git-hooks/pre-commit
- Command line
-
hf download hf://spaces/Vishvam10/cloudenv/git-hooks/pre-commit
-
curl -L -o pre-commit https://huggingface.co/spaces/Vishvam10/cloudenv/resolve/main/git-hooks/pre-commit
389 Bytes
| #!/bin/bash | |
| printf "\nRunning pre-commit hook ..." | |
| current_branch=$(git symbolic-ref --short HEAD) | |
| if [[ "$current_branch" == "main" || "$current_branch" == "master" ]]; then | |
| printf "\n🔴 Direct commits to '$current_branch' are not allowed !" | |
| printf "\nPlease commit to a feature branch and open a pull request." | |
| exit 1 | |
| fi | |
| printf "\n✅ Pre-commit checks passed !" | |
| exit 0 |