diff --git a/src/Commands/BundleCommand.php b/src/Commands/BundleCommand.php index 751cab11..0957491f 100644 --- a/src/Commands/BundleCommand.php +++ b/src/Commands/BundleCommand.php @@ -14,6 +14,7 @@ use Native\Electron\Traits\HandlesZephpyr; use Native\Electron\Traits\HasPreAndPostProcessing; use Native\Electron\Traits\InstallsAppIcon; +use Native\Electron\Traits\LocatesPhpBinary; use Native\Electron\Traits\PrunesVendorDirectory; use Native\Electron\Traits\SetsAppName; use Symfony\Component\Finder\Finder; @@ -28,6 +29,7 @@ class BundleCommand extends Command use HandlesZephpyr; use HasPreAndPostProcessing; use InstallsAppIcon; + use LocatesPhpBinary; use PrunesVendorDirectory; use SetsAppName; diff --git a/src/Traits/PrunesVendorDirectory.php b/src/Traits/PrunesVendorDirectory.php index 5683d8d4..6f9ad0de 100644 --- a/src/Traits/PrunesVendorDirectory.php +++ b/src/Traits/PrunesVendorDirectory.php @@ -16,6 +16,7 @@ abstract protected function buildPath(string $path = ''): string; protected function pruneVendorDirectory() { Process::path($this->buildPath()) + ->timeout(300) ->run('composer install --no-dev', function (string $type, string $output) { echo $output; }); @@ -25,5 +26,11 @@ protected function pruneVendorDirectory() $this->buildPath('/vendor/bin'), $this->buildPath('/vendor/nativephp/php-bin'), ]); + + // Remove custom php binary package directory + $binaryPackageDirectory = $this->binaryPackageDirectory(); + if (! empty($binaryPackageDirectory) && $filesystem->exists($this->buildPath($binaryPackageDirectory))) { + $filesystem->remove($this->buildPath($binaryPackageDirectory)); + } } }