let build command support windows

This commit is contained in:
Jerry 2023-02-01 16:27:05 +08:00
parent 8d761864b9
commit 74cbfb8b73

View File

@ -89,9 +89,10 @@ class BuildCommand extends Command
$phar->startBuffering();
$files = FileSystem::scanDirFiles(SOURCE_ROOT_DIR, true, true);
$separator = '\\' . DIRECTORY_SEPARATOR;
// 只打包 bin / config / resources / src / vendor 目录以及 composer.json / composer.lock / entry.php
$files = array_filter($files, function ($file) {
return preg_match('/(^(bin|config|resources|src|vendor)\\/|^(composer\\.json|README\\.md)$)/', $file);
$files = array_filter($files, function ($file) use ($separator) {
return preg_match('/^(bin|config|resources|src|vendor)' . $separator . '|^(composer\\.json|README\\.md)$/', $file);
});
sort($files);