Skip to content

Commit

Permalink
fix(deps): update dependency cz-conventional-changelog to v3 (#654)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency cz-conventional-changelog to v3

* fix: resolve test with latest cz-conventional-changelog
  • Loading branch information
renovate[bot] authored and jimthedev committed Jul 19, 2019
1 parent 129a779 commit 2a1a111
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 34 deletions.
170 changes: 138 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -72,7 +72,7 @@
},
"dependencies": {
"cachedir": "2.2.0",
"cz-conventional-changelog": "2.1.0",
"cz-conventional-changelog": "3.0.1",
"dedent": "0.7.0",
"detect-indent": "6.0.0",
"find-node-modules": "2.0.0",
Expand Down
6 changes: 6 additions & 0 deletions src/commitizen/init.js
Expand Up @@ -56,6 +56,7 @@ function init (sh, repoPath, adapterNpmName, {
yarn = false,
dev = false,
exact = false,
includeCommitizen = false
} = defaultInitOptions) {

// Don't let things move forward if required args are missing
Expand All @@ -73,6 +74,8 @@ function init (sh, repoPath, adapterNpmName, {
// Generate a string that represents the npm install command
let installAdapterCommand = yarn ? generateYarnAddAdapterCommand(stringMappings, adapterNpmName) : generateNpmInstallAdapterCommand(stringMappings, adapterNpmName);

let installCommitizenCommand = yarn ? generateYarnAddAdapterCommand(stringMappings, "commitizen") : generateNpmInstallAdapterCommand(stringMappings, "commitizen");

// Check for previously installed adapters
if (adapterConfig && adapterConfig.path && adapterConfig.path.length > 0 && !force) {
throw new Error(`A previous adapter is already configured. Use --force to override
Expand All @@ -86,6 +89,9 @@ function init (sh, repoPath, adapterNpmName, {

try {
executeShellCommand(sh, repoPath, installAdapterCommand);
if(includeCommitizen) {
executeShellCommand(sh, repoPath, installCommitizenCommand);
}
addPathToAdapterConfig(sh, CLI_PATH, repoPath, adapterNpmName);
} catch (e) {
console.error(e);
Expand Down
2 changes: 1 addition & 1 deletion test/tests/adapter.js
Expand Up @@ -131,7 +131,7 @@ describe('adapter', function () {
};

// Install an adapter
commitizenInit(sh, config.paths.endUserRepo, 'cz-conventional-changelog');
commitizenInit(sh, config.paths.endUserRepo, 'cz-conventional-changelog', {includeCommitizen: true});

// TEST
expect(function () { adapter.getPrompter('IAMANIMPOSSIBLEPATH'); }).to.throw(Error);
Expand Down

0 comments on commit 2a1a111

Please sign in to comment.