Skip to content

Commit

Permalink
use 8.1 compatible syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Jan 8, 2025
1 parent 679ba0c commit f9311c3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
27 changes: 27 additions & 0 deletions src/Commands/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,33 @@ protected function buildPath(): string
return __DIR__.'/../../resources/js/resources/app';
}

const CLEANUP_PATTERNS = [
// Skip .git and Dev directories
'.git',
'docker',
'packages',

// Only needed for local testing
'vendor/nativephp/electron/vendor',
'vendor/nativephp/laravel/vendor',

'vendor/nativephp/php-bin',
'vendor/nativephp/electron/bin',
'vendor/nativephp/electron/resources',
'node_modules',
'dist',

'**/.github',

'database/*.sqlite',
'database/*.sqlite-shm',
'database/*.sqlite-wal',

'storage/logs/*',
'storage/views/*',
'storage/sessions/*',
];

public function handle(): void
{
$this->setAppName(slugify: true);
Expand Down
29 changes: 1 addition & 28 deletions src/Traits/CopiesToBuildDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,6 @@ trait CopiesToBuildDirectory
{
abstract protected function buildPath(): string;

const SKIP_PATTERNS = [
// Skip .git and Dev directories
'.git',
'docker',
'packages',

// Only needed for local testing
'vendor/nativephp/electron/vendor',
'vendor/nativephp/laravel/vendor',

'vendor/nativephp/php-bin',
'vendor/nativephp/electron/bin',
'vendor/nativephp/electron/resources',
'node_modules',
'dist',

'**/.github',

'database/*.sqlite',
'database/*.sqlite-shm',
'database/*.sqlite-wal',

'storage/logs/*',
'storage/views/*',
'storage/sessions/*',
];

protected function copyToBuildDirectory()
{
intro('Copying App to build directory...');
Expand All @@ -55,7 +28,7 @@ protected function copyToBuildDirectory()

$filter = new RecursiveCallbackFilterIterator($directory, function ($current) {
$relativePath = substr($current->getPathname(), strlen(base_path()) + 1);
$patterns = config('nativephp.cleanup_exclude_files') + static::SKIP_PATTERNS;
$patterns = config('nativephp.cleanup_exclude_files') + static::CLEANUP_PATTERNS;

// Check each skip pattern against the current file/directory
foreach ($patterns as $pattern) {
Expand Down

0 comments on commit f9311c3

Please sign in to comment.