Skip to content

Commit

Permalink
fix(@angular/cli): correctly access root workspace path
Browse files Browse the repository at this point in the history
(cherry picked from commit ae04726)
  • Loading branch information
clydin committed Feb 5, 2021
1 parent d6ba30b commit ceb057e
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
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
Expand Up @@ -22,7 +22,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
Expand Up @@ -256,7 +256,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 ceb057e

Please sign in to comment.