fix: update tar command for macOS compatibility and clean up workflow

This commit is contained in:
Soner Sayakci
2025-02-14 15:27:11 +01:00
parent 6e0952f8e3
commit cf035bcbd5
2 changed files with 8 additions and 3 deletions
-2
View File
@@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
+8 -1
View File
@@ -136,9 +136,16 @@ class TarBuilder
private function runTarCommand(string $tarFilePath, string $sourceDir): void
{
if (PHP_OS_FAMILY === 'Darwin') {
$additionalFlags = ' --disable-copyfile --no-xattrs';
} else {
$additionalFlags = '';
}
// without --disable-copyfile and --no-xattrs combination, tar will fail on macOS
$cmd = sprintf(
'tar --no-xattrs --disable-copyfile -cf %s -C %s . 2>&1',
'tar %s -cf %s -C %s . 2>&1',
$additionalFlags,
escapeshellarg($tarFilePath),
escapeshellarg($sourceDir)
);