Skip to content

Commit

Permalink
Update Cleanup.php
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Apr 26, 2024
1 parent 6d95f98 commit fe29728
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ public function cleanup(array $sourceFiles): void
if (is_link($absolutePath)) {
unlink($absolutePath);
}
/**
* `unlink()` will not work on Windows. `rimdir()` will not work if there are files in the directory.
*
* @see https://stackoverflow.com/a/18262809/336146
*/
if (false !== strpos('WIN', PHP_OS)) {
@rmdir($absolutePath);
}

if ($absolutePath !== realpath($absolutePath)) {
continue;
Expand Down

0 comments on commit fe29728

Please sign in to comment.