Skip to content

Commit 1ca9f52

Browse files
clydinBrocco
authored andcommitted
test: update check-yarn to always use a published version
1 parent 7d7897e commit 1ca9f52

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Diff for: packages/@angular/cli/tasks/init.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { CliConfig } from '../models/config';
77

88
const Task = require('../ember-cli/lib/models/task');
99
const SilentError = require('silent-error');
10-
const packageJson = require('../package.json');
1110

1211

1312
export 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(

Diff for: tests/e2e/tests/commands/new/check-yarn.ts

+1-1
Original file line numberDiff line numberDiff 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)) {

0 commit comments

Comments
 (0)