jira-prepare-commit-msg icon indicating copy to clipboard operation
jira-prepare-commit-msg copied to clipboard

Do not work for sub folders

Open andsan opened this issue 5 years ago • 4 comments

I have husky + this in the package file in a sub folder "ui", not in root of the repo. And it fails at the last step:

JIRA prepare commit msg > Error: Unable to read the file ".git/COMMIT_EDITMSG".

What is the issue? You should already know the git root from before? Not always assume that you are located in the root path.

To verify I changed this line quickly and then it works all the way: const messageFilePath = "../" + getMsgFilePath();

andsan avatar Jan 09 '20 10:01 andsan

I have the same issue. My .git folder is tree levels higher than my package.json.

Ik works if I change this line like @andsan

const messageFilePath = "../../../" + getMsgFilePath();

Simsteve7 avatar Nov 12 '20 21:11 Simsteve7

@Simsteve7 What version do you use? How many git repos/submodules do you have in the folder?

bk201- avatar Nov 14 '20 05:11 bk201-

I'm also experiencing this. package.json placed 3 levels down from the git project root.

jira-prepare-commit-msg 1.6.0 husky 4.3.0

soulstyle avatar Jun 22 '21 23:06 soulstyle

Also experiencing this issue when using lerna - 3 levels down.

adamtay avatar Jun 24 '21 00:06 adamtay