Skip to content

Commit fa5d77e

Browse files
authored
fix: some minor issue in local-build
Merge pull request #1515 from imjustprism/new-update
2 parents c6f83ce + e79c090 commit fa5d77e

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/dependencies/local-build.ps1

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,13 @@ try {
468468
$relative = $file.Name
469469
}
470470

471-
if ($IsLinuxPlatform -or $IsMacOSPlatform) {
472-
# normalize slashes for non-windows platforms
473-
$relative = $relative -replace '\\', '/'
474-
}
471+
$relative = $relative -replace '\\', '/'
475472

476473
$relative
477474
}
478475

479-
# write the file list so 7-zip can work through the tree efficiently
480-
$relativePaths | Set-Content -Path $filesListPath -Encoding UTF8
476+
$utf8NoBom = New-Object System.Text.UTF8Encoding $false
477+
[System.IO.File]::WriteAllLines($filesListPath, $relativePaths, $utf8NoBom)
481478

482479
$passwordArgs = @()
483480
if (-not $NoPassword) {
@@ -491,12 +488,8 @@ try {
491488
}
492489
$archiveArgs += $passwordArgs
493490
$archiveArgs += $apbxPath
494-
if ($IsWindowsPlatform) {
495-
$archiveArgs += '@"{0}"' -f $filesListPath
496-
} else {
497-
# p7zip refuses -spf with relative paths so use plain @$list
498-
$archiveArgs += "@$filesListPath"
499-
}
491+
# dont add extra quotes around the @ syntax as it breaks 7z parser
492+
$archiveArgs += "@$filesListPath"
500493

501494
Invoke-SevenZip -ArgumentList $archiveArgs -ErrorContext 'Creating APBX archive' -ArchivePath $apbxPath
502495

0 commit comments

Comments
 (0)