setup-hooks.sh 490 B

12345678910111213141516171819
  1. #!/bin/bash
  2. # Source path of the precommit hook
  3. SOURCE_HOOK="tools/git-hooks/pre-commit"
  4. # Destination path of the pre-commit hook
  5. DEST_HOOK=".git/hooks/pre-commit"
  6. # Copy the precommit hook to .git/hooks directory
  7. cp "$SOURCE_HOOK" "$DEST_HOOK"
  8. # Make the pre-commit hook executable
  9. chmod +x "$DEST_HOOK"
  10. # Install ESLint and related dependencies
  11. npm install eslint -g
  12. echo "ESLint and related dependencies installed."
  13. echo "Pre-commit hook copied and made executable successfully!"