Skip to content

Commit

Permalink
fix(@angular/cli): correctly access root workspace path
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin committed Feb 5, 2021
1 parent 4c6d175 commit ae04726
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/angular/cli/commands/add-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class AddCommand extends SchematicCommand<AddCommandSchema> {
}

async run(options: AddCommandSchema & Arguments) {
await ensureCompatibleNpm(this.context.root);
await ensureCompatibleNpm(this.workspace.root);

if (!options.collection) {
this.logger.fatal(
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/cli/commands/new-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class NewCommand extends SchematicCommand<NewCommandSchema> {
}

public async run(options: NewCommandSchema & Arguments) {
await ensureCompatibleNpm(this.context.root);
await ensureCompatibleNpm(this.workspace.root);

// Register the version of the CLI in the registry.
const packageJson = require('../package.json');
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/cli/commands/update-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {

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

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

0 comments on commit ae04726

Please sign in to comment.