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

git cz fails when not in the root directory #187

Closed
pmcelhaney opened this issue Apr 8, 2016 · 2 comments · Fixed by #292
Closed

git cz fails when not in the root directory #187

pmcelhaney opened this issue Apr 8, 2016 · 2 comments · Fixed by #292

Comments

@pmcelhaney
Copy link
Contributor

When I try to run git cz and I'm not in the root directory I get an error.

~/code/cz-cli/src (run-from-anywhere)
$ git cz
./node_modules/cz-conventional-changelog /Users/patrickmcelhaney/code/cz-cli/src
/usr/local/lib/node_modules/commitizen/dist/commitizen/adapter.js:185
    throw error;
    ^

Error: Could not resolve /Users/patrickmcelhaney/code/cz-cli/src/node_modules/cz-conventional-changelog
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.require.resolve (internal/module.js:23:19)
    at resolveAdapterPath (/usr/local/lib/node_modules/commitizen/dist/commitizen/adapter.js:182:20)
    at gitCz (/usr/local/lib/node_modules/commitizen/dist/cli/strategies/git-cz.js:77:35)
    at Object.bootstrap (/usr/local/lib/node_modules/commitizen/dist/cli/git-cz.js:32:27)
    at Object.<anonymous> (/usr/local/lib/node_modules/commitizen/bin/git-cz.js:2:34)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
@ta2edchimp
Copy link

A mixture of how we detect the current git repo's root and resolve the path to a required module using findup or find-up over at ghooks could possibly be an entry point for a possible fix.

pmcelhaney pushed a commit to pmcelhaney/cz-cli that referenced this issue Jul 24, 2016
looks for a local cz adapter relative to the project root rather than the current directory

closes commitizen#187
pmcelhaney pushed a commit to pmcelhaney/cz-cli that referenced this issue Jul 24, 2016
looks for the adapter file relative to the project root rather than cwd

closes commitizen#187
LinusU pushed a commit that referenced this issue Aug 3, 2016
looks for the adapter file relative to the project root rather than cwd

closes #187
@Wildhammer
Copy link

Is there any way I can achieve this inside package.json? like passing an argument or something

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.

3 participants