Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7f71406

Browse files
committed
fix(@angular/build): cleanup karma temporary directory after process exit
The temporary directory created for the karma builder will now be cleanedup after the process exits.(cherry picked from commit1c2d49e)
1 parent9004951 commit7f71406

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎packages/angular/build/src/builders/karma/application_builder.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
importtype{BuilderContext,BuilderOutput}from'@angular-devkit/architect';
1010
importtype{Config,ConfigOptions,FilePattern,InlinePluginDef,Server}from'karma';
1111
import{randomUUID}from'node:crypto';
12+
import{rmSync}from'node:fs';
1213
import*asfsfrom'node:fs/promises';
1314
importtype{IncomingMessage,ServerResponse}from'node:http';
1415
import{createRequire}from'node:module';
@@ -386,6 +387,12 @@ async function initializeApplication(
386387
constoutputPath=path.join(context.workspaceRoot,'dist/test-out',randomUUID());
387388
constprojectSourceRoot=awaitgetProjectSourceRoot(context);
388389

390+
// Setup exit cleanup for temporary directory
391+
consthandleProcessExit=()=>rmSync(outputPath,{recursive:true,force:true});
392+
process.once('exit',handleProcessExit);
393+
process.once('SIGINT',handleProcessExit);
394+
process.once('uncaughtException',handleProcessExit);
395+
389396
const[karma,entryPoints]=awaitPromise.all([
390397
import('karma'),
391398
collectEntrypoints(options,context,projectSourceRoot),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp