diff --git a/lib/commands/init.js b/lib/commands/init.js index 855e0ea1..2f055105 100644 --- a/lib/commands/init.js +++ b/lib/commands/init.js @@ -71,7 +71,7 @@ module.exports = Command.extend({ validateAndRun() { let versions = getVersions(this.project.root); - if (versions.corber.project !== undefined) { + if (versions.corber.project.required !== undefined) { throw `You cannot use ${chalk.green('corber init')} if corber is ` + 'already present in your project\'s package.json'; } diff --git a/node-tests/unit/commands/init-test.js b/node-tests/unit/commands/init-test.js index 25efe46b..db5d1ae4 100644 --- a/node-tests/unit/commands/init-test.js +++ b/node-tests/unit/commands/init-test.js @@ -109,7 +109,9 @@ describe('Init Command', function() { td.replace('../../../lib/utils/get-versions', () => { return { corber: { - project: '1.0.0' + project: { + required: '1.0.0' + } } }; });