File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments