Skip to content

Commit

Permalink
fix(@angular/cli): properly check the project status (#4381)
Browse files Browse the repository at this point in the history
Check for either angular-cli or @angular/cli in the dependencies of the current project.

Fixes #4379
  • Loading branch information
hansl authored Feb 3, 2017
1 parent b0c1551 commit 1dd5399
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/@angular/cli/ember-cli/lib/models/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ Command.prototype.validateAndRun = function(args) {

if (this.works === 'insideProject' && !this.isWithinProject) {
return Promise.reject(new SilentError(
'You have to be inside an angular-cli project in order to use ' +
'You have to be inside an Angular CLI project in order to use ' +
'the ' + chalk.green(this.name) + ' command.'
));
}

if (this.works === 'outsideProject' && this.isWithinProject) {
return Promise.reject(new SilentError(
'You cannot use the ' + chalk.green(this.name) + ' command inside an angular-cli project.'
'You cannot use the ' + chalk.green(this.name) + ' command inside an Angular CLI project.'
));
}

Expand Down
3 changes: 2 additions & 1 deletion packages/@angular/cli/ember-cli/lib/models/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ Project.prototype.name = function() {
@return {Boolean} Whether this is an Ember CLI project
*/
Project.prototype.isEmberCLIProject = function() {
return (this.cli ? this.cli.npmPackage : 'ember-cli') in this.dependencies();
return 'angular-cli' in this.dependencies()
|| '@angular/cli' in this.dependencies();
};

/**
Expand Down

0 comments on commit 1dd5399

Please sign in to comment.