From 1dd53995b0d6231e1be5a699a801245bfe2cb6a7 Mon Sep 17 00:00:00 2001 From: Hans Date: Thu, 2 Feb 2017 16:54:47 -0800 Subject: [PATCH] fix(@angular/cli): properly check the project status (#4381) Check for either angular-cli or @angular/cli in the dependencies of the current project. Fixes #4379 --- packages/@angular/cli/ember-cli/lib/models/command.js | 4 ++-- packages/@angular/cli/ember-cli/lib/models/project.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/@angular/cli/ember-cli/lib/models/command.js b/packages/@angular/cli/ember-cli/lib/models/command.js index 562ae731157c..58e68b4c4c8a 100644 --- a/packages/@angular/cli/ember-cli/lib/models/command.js +++ b/packages/@angular/cli/ember-cli/lib/models/command.js @@ -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.' )); } diff --git a/packages/@angular/cli/ember-cli/lib/models/project.js b/packages/@angular/cli/ember-cli/lib/models/project.js index 56221b5a5330..35e543e7335f 100644 --- a/packages/@angular/cli/ember-cli/lib/models/project.js +++ b/packages/@angular/cli/ember-cli/lib/models/project.js @@ -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(); }; /**