commitizen / cz-cli

The commitizen command line utility. #BlackLivesMatter
http://commitizen.github.io/cz-cli/
MIT License
16.7k stars 547 forks source link

Couldn't re-exec init when yarn failed on init #707

Open Menci opened 4 years ago

Menci commented 4 years ago
root@syzoj-test-vm:~/syzoj-ng-app# commitizen init cz-conventional-changelog --yarn --dev --exact
Attempting to initialize using the npm package cz-conventional-changelog
yarn add v1.19.0
[1/4] Resolving packages...
[2/4] Fetching packages...
error Incorrect integrity when fetching from the cache
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
root@syzoj-test-vm:~/syzoj-ng-app# commitizen init cz-conventional-changelog --yarn --dev --exact
Attempting to initialize using the npm package cz-conventional-changelog
Error: Error: A previous adapter is already configured. Use --force to override
    adapterConfig.path: ./node_modules/cz-conventional-changelog
    repoPath: /root/syzoj-ng-app
    CLI_PATH: /usr/local/share/.config/yarn/global/node_modules/commitizen/
    installAdapterCommand: yarn add cz-conventional-changelog --dev --exact
    adapterNpmName: cz-conventional-changelog

Only removing the new entries from package.json can I run the init command again.

dmwelch commented 4 years ago

Did you try the --force flag?

Error: Error: A previous adapter is already configured. Use --force to override

Menci commented 4 years ago

That should work. But I think it's better to check the previous adapter is the current installing one and do it silently.