CDCgov / prime-devops

Apache License 2.0
4 stars 2 forks source link

.git/hooks folder has directories instead of bash scripts when downloading/Cloning the ReportStream repository from scratch #76

Closed aurora-a-k-a-lightning closed 1 year ago

aurora-a-k-a-lightning commented 1 year ago

New members of ReportStream, when downloading the ReportStream repository to their local machine retrieve the .git/hooks folder's contents as directories instead of bash scripts.

This causes error in the pre-commit phases as the pre-commit hook is expecting a script to run, but instead tries to execute... a directory?

The error is similar to this:

$ git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- frontend-react/src/hooks/UseFileHandler.test.ts
10:31:32.532: [prime-reportstream] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false commit -F /private/var/folders/km/89sm81sd01dfkzrhy1dvbbwr0000gq/T/git-commit-msg-.txt --
fatal: cannot exec '.git/hooks/pre-commit': Permission denied

A workaround is that a Veteran member of ReportStream zips up the /git/hooks folder with the bash scripts and sends to the new team member.

We would like to not have to do that :laughing:

lucasdze commented 1 year ago

@ahay-agile6

The script is now fixed and merged to master branch. https://github.com/CDCgov/prime-reportstream/pull/7451

For anyone that was facing this issue,

  1. delete the hook directory under .git/
  2. Pull the latest code updates from master
  3. run .envirment/githooks.sh install