Skip to content

Commit 09c995b

Browse files
authored
Merge pull request #50 from dbx192/main
Update AppPluginZipCommand.php
2 parents 8496ef4 + 8621db3 commit 09c995b

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)