Skip to content

Commit 5043638

Browse files
committed
fix(ng-dev): move node_modules deletation to later and fix github API params (#3046)
The delete needs to be delayed as otherwise prettier will not be found. Also, the command was incorrect. PR Close #3046
1 parent 937d2f8 commit 5043638

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ng-dev/release/publish/actions.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,6 @@ export abstract class ReleaseAction {
366366
protected async checkoutUpstreamBranch(branchName: string) {
367367
this.git.run(['fetch', '-q', this.git.getRepoGitUrl(), branchName]);
368368
this.git.run(['checkout', '-q', 'FETCH_HEAD', '--detach']);
369-
try {
370-
// Remove node_modules even if they are ignored. (We do not want to run -dxf to avoid deleting other files suchs as .ng-dev-lock)
371-
this.git.run(['clean', '-qdfX **/node_modules']);
372-
} catch {}
373369
}
374370

375371
/** Installs all Yarn dependencies in the current branch. */
@@ -386,7 +382,9 @@ export abstract class ReleaseAction {
386382
// This is a workaround for: https://github.com/yarnpkg/yarn/issues/8146. Even though
387383
// we might be able to fix this with Yarn 2+, it is reasonable ensuring clean node modules.
388384
// TODO: Remove this when we use Yarn 2+ in all Angular repositories.
389-
await fs.rm(nodeModulesDir, {force: true, recursive: true, maxRetries: 3});
385+
try {
386+
this.git.run(['clean', '-qdfX', '**/node_modules']);
387+
} catch {}
390388
await ExternalCommands.invokeYarnInstall(this.projectDir);
391389
}
392390

0 commit comments

Comments
 (0)