Skip to content

Commit

Permalink
fix(nx): add check to see if CLI version is more recent
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored and vsavkin committed Sep 11, 2019
1 parent 20b292b commit d5b4453
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function updateCLI() {

if (
cliVersion &&
(cliVersion.startsWith('8.1') ||
(cliVersion > 8.1 ||
cliVersion.startsWith('8.1') ||
cliVersion.startsWith('~8.1') ||
cliVersion.startsWith('^8.1'))
) {
Expand Down
11 changes: 11 additions & 0 deletions packages/angular/src/migrations/update-8-5-0/upgrade-cli-8-3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ function updateCLI() {
const rule = chain([
updateJsonInTree('package.json', json => {
json.devDependencies = json.devDependencies || {};
const cliVersion = json.devDependencies['@angular/cli'];

if (
cliVersion &&
(cliVersion > 8.3 ||
cliVersion.startsWith('8.3') ||
cliVersion.startsWith('~8.3') ||
cliVersion.startsWith('^8.3'))
) {
return json;
}

if (json['devDependencies']['@angular/cli']) {
json['devDependencies']['@angular/cli'] = '8.3.3';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const updateCLI = updateJsonInTree('package.json', json => {

if (
cliVersion &&
(cliVersion.startsWith('8.1') ||
(cliVersion > 8.1 ||
cliVersion.startsWith('8.1') ||
cliVersion.startsWith('~8.1') ||
cliVersion.startsWith('^8.1'))
) {
Expand Down

0 comments on commit d5b4453

Please sign in to comment.