Skip to content

Commit ae04726

Browse files
committed
fix(@angular/cli): correctly access root workspace path
1 parent 4c6d175 commit ae04726

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/angular/cli/commands/add-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class AddCommand extends SchematicCommand<AddCommandSchema> {
3838
}
3939

4040
async run(options: AddCommandSchema & Arguments) {
41-
await ensureCompatibleNpm(this.context.root);
41+
await ensureCompatibleNpm(this.workspace.root);
4242

4343
if (!options.collection) {
4444
this.logger.fatal(

packages/angular/cli/commands/new-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class NewCommand extends SchematicCommand<NewCommandSchema> {
2424
}
2525

2626
public async run(options: NewCommandSchema & Arguments) {
27-
await ensureCompatibleNpm(this.context.root);
27+
await ensureCompatibleNpm(this.workspace.root);
2828

2929
// Register the version of the CLI in the registry.
3030
const packageJson = require('../package.json');

packages/angular/cli/commands/update-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
254254

255255
// tslint:disable-next-line:no-big-function
256256
async run(options: UpdateCommandSchema & Arguments) {
257-
await ensureCompatibleNpm(this.context.root);
257+
await ensureCompatibleNpm(this.workspace.root);
258258

259259
// Check if the @angular-devkit/schematics package can be resolved from the workspace root
260260
// This works around issues with packages containing migrations that cannot directly depend on the package

0 commit comments

Comments
 (0)