diff --git a/src/SevenZip.php b/src/SevenZip.php index ca2cab3..a7995fb 100644 --- a/src/SevenZip.php +++ b/src/SevenZip.php @@ -231,13 +231,19 @@ public function usePackageProvided7ZipExecutable(): ?string }; if ($os !== null && $arch !== null) { - return sprintf( + $path = sprintf( "%s/../bin/7z%d-%s%s", __DIR__, $version, $os, $os === "mac" ? "" : "-" . $arch ); + + $path = realpath($path); + + if (is_executable($path)) { + return $path; + } } return null; diff --git a/tests/SevenZipTest.php b/tests/SevenZipTest.php index a325b7e..7ea5654 100644 --- a/tests/SevenZipTest.php +++ b/tests/SevenZipTest.php @@ -502,8 +502,6 @@ public function testTarBeforeImplicit(): void ->target($tarPath) ->compress(); - - // Assert that the tar file exists $this->assertFileExists($tarPath); }