Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not work for sub folders #11

Open
andsan opened this issue Jan 9, 2020 · 4 comments · Fixed by #13
Open

Do not work for sub folders #11

andsan opened this issue Jan 9, 2020 · 4 comments · Fixed by #13

Comments

@andsan
Copy link

andsan commented Jan 9, 2020

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();

@Simsteve7
Copy link

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();

@bk201-
Copy link
Owner

bk201- commented Nov 14, 2020

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

@soulstyle
Copy link

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

@adamtay
Copy link

adamtay commented Jun 24, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants