Skip to content

Commit 0eb4b43

Browse files
committed
Fixing cleanup permissions issue possible on Windows
1 parent 19dd3e4 commit 0eb4b43

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Update/RecipePatcher.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Composer\IO\IOInterface;
1515
use Composer\Util\ProcessExecutor;
16+
use Symfony\Component\Filesystem\Exception\IOException;
1617
use Symfony\Component\Filesystem\Filesystem;
1718

1819
class RecipePatcher
@@ -126,7 +127,12 @@ public function generatePatch(array $originalFiles, array $newFiles): RecipePatc
126127
$blobs
127128
);
128129
} finally {
129-
$this->filesystem->remove($tmpPath);
130+
try {
131+
$this->filesystem->remove($tmpPath);
132+
} catch (IOException $e) {
133+
// this can sometimes fail due to git file permissions
134+
// if that happens, just leave it: we're in the temp directory anyways
135+
}
130136
}
131137
}
132138

0 commit comments

Comments
 (0)