File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
packages/@angular/cli/tasks
tests/e2e/tests/commands/new Expand file tree Collapse file tree 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';
77
88const Task = require ( '../ember-cli/lib/models/task' ) ;
99const SilentError = require ( 'silent-error' ) ;
10- const packageJson = require ( '../package.json' ) ;
1110
1211
1312export default Task . extend ( {
@@ -43,7 +42,15 @@ export default Task.extend({
4342
4443 const cwd = this . project . root ;
4544 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+ }
4754
4855 if ( ! commandOptions . skipCommit ) {
4956 const commitMessage = fs . readFileSync (
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export default function() {
77 return Promise . resolve ( )
88 . then ( ( ) => process . chdir ( getGlobalVariable ( 'tmp-root' ) ) )
99 . then ( ( ) => ng ( 'set' , '--global' , 'packageManager=default' ) )
10- . then ( ( ) => ng ( 'new' , 'foo' ) )
10+ . then ( ( ) => ng ( 'new' , 'foo' , '--version=1.6.8' ) )
1111 . then ( ( { stdout } ) => {
1212 // Assuming yarn is installed and checking for message with yarn.
1313 if ( ! stdout . match ( yarnRegEx ) ) {
You can’t perform that action at this time.
0 commit comments