Skip to content

Commit 8621db3

Browse files
authored
Update AppPluginZipCommand.php
全部使用反斜杠,避免windows下打包,linux上解压出错。
1 parent 8496ef4 commit 8621db3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Commands/AppPluginZipCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ protected function zipDirectory($name, $sourceDir, $zipFilePath, array $excludeP
7474
foreach ($files as $file) {
7575
if (!$file->isDir()) {
7676
$filePath = $file->getRealPath();
77-
$relativePath = $name . DIRECTORY_SEPARATOR . substr($filePath, strlen($sourceDir) + 1);
77+
// 关键修复:统一使用正斜杠 '/',避免 Windows 反斜杠污染 ZIP
78+
$relativePath = $name . '/' . str_replace('\\', '/', substr($filePath, strlen($sourceDir) + 1));
7879

7980
// 修正排除目录的判断逻辑,确保所有层级都能排除
8081
$shouldExclude = false;

0 commit comments

Comments
 (0)