File tree 2 files changed +10
-3
lines changed
packages/@angular/cli/tasks
tests/e2e/tests/commands/new
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import { CliConfig } from '../models/config';
7
7
8
8
const Task = require ( '../ember-cli/lib/models/task' ) ;
9
9
const SilentError = require ( 'silent-error' ) ;
10
- const packageJson = require ( '../package.json' ) ;
11
10
12
11
13
12
export default Task . extend ( {
@@ -43,7 +42,15 @@ export default Task.extend({
43
42
44
43
const cwd = this . project . root ;
45
44
const schematicName = CliConfig . fromGlobal ( ) . get ( 'defaults.schematics.newApp' ) ;
46
- commandOptions . version = packageJson . version ;
45
+
46
+ if ( commandOptions . version ) {
47
+ this . ui . writeLine ( chalk . yellow (
48
+ '*** The "--version" option is intended for internal development purposes only.'
49
+ + ' Use at your own risk. ***' ) ) ;
50
+ } else {
51
+ const packageJson = require ( '../package.json' ) ;
52
+ commandOptions . version = packageJson . version ;
53
+ }
47
54
48
55
if ( ! commandOptions . skipCommit ) {
49
56
const commitMessage = fs . readFileSync (
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export default function() {
7
7
return Promise . resolve ( )
8
8
. then ( ( ) => process . chdir ( getGlobalVariable ( 'tmp-root' ) ) )
9
9
. then ( ( ) => ng ( 'set' , '--global' , 'packageManager=default' ) )
10
- . then ( ( ) => ng ( 'new' , 'foo' ) )
10
+ . then ( ( ) => ng ( 'new' , 'foo' , '--version=1.6.8' ) )
11
11
. then ( ( { stdout } ) => {
12
12
// Assuming yarn is installed and checking for message with yarn.
13
13
if ( ! stdout . match ( yarnRegEx ) ) {
You can’t perform that action at this time.
0 commit comments