Skip to content

Commit 3237ca7

Browse files
committed
fix: defer WP-CLI wrapper cleanup to runtime owner
1 parent db6588b commit 3237ca7

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

packages/runtime-playground/src/wp-cli-command-handlers.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ export function shellArgv(command: string): string[] {
5757

5858
export function wpCliPhpScript(argv: string[]): string {
5959
return `<?php
60-
register_shutdown_function(static function (): void {
61-
@unlink(__FILE__);
62-
});
6360
putenv('SHELL_PIPE=0');
6461
$GLOBALS['argv'] = array_merge(array('/tmp/wp-cli.phar', '--path=/wordpress', '--no-color'), json_decode(${JSON.stringify(JSON.stringify(argv))}, true));
6562
${phpCliStreamConstants()}
@@ -74,7 +71,6 @@ export async function runWithTemporaryWpCliScript<T>(filesystem: WpCliTemporaryS
7471
try {
7572
return await run(scriptPath)
7673
} finally {
77-
// The wrapper also removes itself on PHP shutdown, so a missing file is expected here.
7874
await Promise.resolve(filesystem.unlink(scriptPath)).catch(() => undefined)
7975
}
8076
}

0 commit comments

Comments
 (0)