mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-22 16:15:34 +08:00
simplify file filtering
This commit is contained in:
@@ -85,13 +85,13 @@ class BuildCommand extends Command
|
|||||||
|
|
||||||
private function build(string $target, string $entry): void
|
private function build(string $target, string $entry): void
|
||||||
{
|
{
|
||||||
$phar = new \Phar($target, 0, $target);
|
$phar = new \Phar($target, 0);
|
||||||
|
|
||||||
$phar->startBuffering();
|
$phar->startBuffering();
|
||||||
$files = FileSystem::scanDirFiles(SOURCE_ROOT_DIR, true, true);
|
$files = FileSystem::scanDirFiles(SOURCE_ROOT_DIR, true, true);
|
||||||
// 只打包 bin / config / resources / src / vendor
|
// 只打包 bin / config / resources / src / vendor 目录以及 composer.json / composer.lock / entry.php
|
||||||
$files = array_filter($files, function ($file) {
|
$files = array_filter($files, function ($file) {
|
||||||
return preg_match('#^(bin|config|resources|src|vendor)/#', $file);
|
return preg_match('/(^(bin|config|resources|src|vendor)\\/|^(composer\\.json|README\\.md)$)/', $file);
|
||||||
});
|
});
|
||||||
sort($files);
|
sort($files);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user