Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Commands/BundleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,6 +29,7 @@ class BundleCommand extends Command
use HandlesZephpyr;
use HasPreAndPostProcessing;
use InstallsAppIcon;
use LocatesPhpBinary;
use PrunesVendorDirectory;
use SetsAppName;

Expand Down
7 changes: 7 additions & 0 deletions src/Traits/PrunesVendorDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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->remove($this->buildPath($binaryPackageDirectory));
}
}
}
Loading