diff --git a/src/Commands/BuildCommand.php b/src/Commands/BuildCommand.php index 29a1868..fe290dd 100644 --- a/src/Commands/BuildCommand.php +++ b/src/Commands/BuildCommand.php @@ -38,33 +38,6 @@ protected function buildPath(): string return __DIR__.'/../../resources/js/resources/app'; } - const CLEANUP_PATTERNS = [ - // .git and dev directories - '.git', - 'dist', - 'docker', - 'packages', - '**/.github', - - // Potentially containing sensitive info - 'database/*.sqlite', - 'database/*.sqlite-shm', - 'database/*.sqlite-wal', - - 'storage/framework/sessions/*', - 'storage/framework/testing/*', - 'storage/framework/cache/*', - 'storage/framework/views/*', - 'storage/logs/*', - - // Only needed for local testing - 'vendor/nativephp/electron/resources', - 'vendor/nativephp/electron/vendor', - 'vendor/nativephp/electron/bin', - 'vendor/nativephp/laravel/vendor', - 'vendor/nativephp/php-bin', - ]; - public function handle(): void { $this->setAppName(slugify: true); diff --git a/src/Traits/CopiesToBuildDirectory.php b/src/Traits/CopiesToBuildDirectory.php index 4acdef4..4c713de 100644 --- a/src/Traits/CopiesToBuildDirectory.php +++ b/src/Traits/CopiesToBuildDirectory.php @@ -22,12 +22,16 @@ protected function copyToBuildDirectory() $buildPath = $this->buildPath(); $filesystem = new Filesystem; + $patterns = array_merge( + config('nativephp-internal.cleanup_exclude_files', []), + config('nativephp.cleanup_exclude_files', []) + ); + // Clean and create build directory $filesystem->remove($buildPath); $filesystem->mkdir($buildPath); // A filtered iterator that will exclude files matching our skip patterns - $patterns = array_merge(static::CLEANUP_PATTERNS, config('nativephp.cleanup_exclude_files', [])); $directory = new RecursiveDirectoryIterator($sourcePath, RecursiveDirectoryIterator::SKIP_DOTS | RecursiveDirectoryIterator::FOLLOW_SYMLINKS); $filter = new RecursiveCallbackFilterIterator($directory, function ($current) use ($patterns) {