From ee9d3a0a8323f94cb63be136b369a395550c36a2 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 24 Sep 2026 21:30:14 +0200 Subject: [PATCH] Fix box compile on windows --- src/Box.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Box.php b/src/Box.php index bf390903..57a044b5 100644 --- a/src/Box.php +++ b/src/Box.php @@ -165,9 +165,14 @@ public function endBuffering(?callable $dumpAutoload): void $this->phar->buildFromDirectory($tmp); } } finally { - FS::remove($tmp); - // Must happen _after_ the remove as the latter has higher priority. - chdir($cwd); + if (PHP_OS_FAMILY === 'Windows') { + chdir($cwd); + FS::remove($tmp); + } else { + FS::remove($tmp); + // Must happen _after_ the remove as the latter has higher priority. + chdir($cwd); + } } $this->buffering = false;