Skip to content

ENOENT: no such file or directory, open '.git/COMMIT_EDITMSG' #19

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

Closed
jmendiara opened this issue Dec 30, 2016 · 1 comment · Fixed by #22
Closed

ENOENT: no such file or directory, open '.git/COMMIT_EDITMSG' #19

jmendiara opened this issue Dec 30, 2016 · 1 comment · Fixed by #22
Labels

Comments

@jmendiara
Copy link

When the .git directory is not in the same path than your execution directory, this error is thrown

$ pwd                                                                                               
/Users/javier/Documents/tdaf-pibot/paco                                       
$ node_modules/.bin/conventional-changelog-lint -e                                                  
/Users/javier/Documents/tdaf-pibot/paco/node_modules/conventional-changelog-lint/distribution/cli.js:161                                                                         
        throw error;                                                                                                                                                                       
        ^                                                                                                                                                                                  
                                                                                                                                                                                           
Error: ENOENT: no such file or directory, open '.git/COMMIT_EDITMSG'                                                                                                                       
    at Error (native)                                                                                                                                                                                                                             

in the example, the .git directory is /Users/javier/Documents/tdaf-pibot/.git but the node project with the package.json is in /Users/javier/Documents/tdaf-pibot/paco (one directory inside)

I think this can be solved by executing git rev-parse --show-toplevel for obtaining the current git directory and make an absolute path in https://github.com/marionebl/conventional-changelog-lint/blob/master/source/library/get-messages.js#L29

WDYT?

@marionebl
Copy link
Contributor

@jmendiara Sounds good, mind contributing a PR?

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

Successfully merging a pull request may close this issue.

2 participants