@@ -46,6 +46,9 @@ export class Version {
46
46
isKnown ( ) { return this . _version !== null ; }
47
47
48
48
isLocal ( ) { return this . isKnown ( ) && path . isAbsolute ( this . _version ) ; }
49
+ isGreaterThanOrEqualTo ( other : SemVer ) {
50
+ return this . _semver . compare ( other ) >= 0 ;
51
+ }
49
52
50
53
get major ( ) { return this . _semver ? this . _semver . major : 0 ; }
51
54
get minor ( ) { return this . _semver ? this . _semver . minor : 0 ; }
@@ -105,7 +108,7 @@ export class Version {
105
108
if ( v . isLocal ( ) ) {
106
109
console . warn ( yellow ( 'Using a local version of angular. Proceeding with care...' ) ) ;
107
110
} else {
108
- if ( v . major != 2 || ( ( v . minor == 3 && v . patch == 0 ) || v . minor < 3 ) ) {
111
+ if ( ! v . isGreaterThanOrEqualTo ( new SemVer ( '2.3.1' ) ) ) {
109
112
console . error ( bold ( red ( stripIndents `
110
113
This version of CLI is only compatible with angular version 2.3.1 or better. Please
111
114
upgrade your angular version, e.g. by running:
@@ -129,7 +132,7 @@ export class Version {
129
132
It seems like you're using a project generated using an old version of the Angular CLI.
130
133
The latest CLI now uses webpack and has a lot of improvements including a simpler
131
134
workflow, a faster build, and smaller bundles.
132
-
135
+
133
136
To get more info, including a step-by-step guide to upgrade the CLI, follow this link:
134
137
https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.14
135
138
` + '\n' ) ) ) ;
0 commit comments