-
Notifications
You must be signed in to change notification settings - Fork 934
Configuration is not loaded in prompt-cli #100
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
Labels
Comments
Thanks for catching this and the analysis/debugging. You are right - replacing Would you mind contributing the fix and adding a test case to |
marionebl
added a commit
that referenced
this issue
Oct 26, 2017
marionebl
added a commit
that referenced
this issue
Oct 26, 2017
Fixed via release 4.2.2 |
I've just seen your message, thanks @marionebl! |
4 tasks
bpedersen
pushed a commit
to bpedersen/commitlint
that referenced
this issue
Oct 15, 2019
…-changelog#100 (conventional-changelog#117) * chore: refactoring version page * refactor: migrate version page to hooks * refactor: Version page better imports * fix: conventional-changelog#100 render not found on click item * test: add test for version page * chore: update mocks * test: add scenario for not found package * chore: fix wrong mock path * chore: update mock * chore: add todo list
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Before going forward I want to thank you, I have been using the suite (
config-angular
,cli
,prompt-cli
) for a long time, it's amazing, great work!Today I finally decided to update to latest (4.2.0), and then at the time to commit, I noticed
prompt-cli
was no longer providing valid types when I hit tab.Below is the flow executed to load the config so you can see that none of the steps is providing options.cwd
@commitlint/prompt-cli
calls prompt from@commitlint/prompt
without args (here)@commitlint/prompt
calls load from@commitlint/core
without args (here)@commitlint/core
load 2nd param, options, defaults to{cwd: ''}
(here)@commitlint/core
load uses options.cwd to load the config (here)Since no options are provided to
@commitlint/core
load, then it uses defaults, and therefore no config is loaded as it tries to load usingoptions.cwd
which is an empty string.After having detected this I was wondering why
@commitlint/cli
is not having the same issue, and the answer is here, that as you can see it usesprocess.cwd()
as the default instead of an empty string.So finally and as an attempt to solve the issue I replicated the logic in
@commitlint/cli
, so I set options.cwd default in@commitlint/core
load toprocess.cwd()
as follows:And indeed this worked.
Another alternative would be to pass
{cwd: process.cwd()}
when prompt calls load...What do you think?
The text was updated successfully, but these errors were encountered: