You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The root cause of this issue is that git.getMsgFilePath() returns .git/COMMIT_EDITMSG. If husky cannot resolve the directory based on the cwd, the script errors out here message = fs.readFileSync(messageFilePath, { encoding: 'utf-8' });
As a suggestion, change git.writeJiraTicket() to do the following.
I have a subfolder called client where my package.json and .jirapreparecommitmsgrc file live. I managed to fix this issue with subfolders by adding the following to my .husky/prepare-commit-msg file:
cd client/ || exit
npx jira-prepare-commit-msg "./../$1"
This way it will pick up my .jirapreparecommitmsgrc config while also being able to find .git/COMMIT_EDITMSG by using a relative path.
Same as issue #11 which has been closed.
If working in a subdirectory where
package.json
is not at the root directory, the following error message is outputted:JIRA prepare commit msg > Error: Unable to read the file ".git/COMMIT_EDITMSG".
The text was updated successfully, but these errors were encountered: