Skip to content

Commit

Permalink
fix(decompress): Fix 'Expand-7zipArchive()' for nested archive (#4582)
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored Dec 15, 2021
1 parent 6f60059 commit cd6d31d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ function Invoke-ExternalCommand {
return $false
}
if ($LogPath -and ($FilePath -notmatch '(^|\W)msiexec($|\W)')) {
Out-File -FilePath $LogPath -Encoding ASCII -Append -InputObject $Process.StandardOutput.ReadToEnd()
Out-File -FilePath $LogPath -Encoding ASCII -Append -InputObject $Process.StandardError.ReadToEnd()
Out-File -FilePath $LogPath -Encoding Default -Append -InputObject $Process.StandardOutput.ReadToEnd()
Out-File -FilePath $LogPath -Encoding Default -Append -InputObject $Process.StandardError.ReadToEnd()
}
$Process.WaitForExit()
if ($Process.ExitCode -ne 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/decompress.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function Expand-7zipArchive {
# Check for tar
$Status = Invoke-ExternalCommand $7zPath @('l', "`"$Path`"") -LogPath $LogPath
if ($Status) {
$TarFile = (Get-Content -Path $LogPath)[-4] -replace '.{53}(.*)', '$1' # get inner tar file name
$TarFile = (Get-Content -Path $LogPath)[-5] -replace '.{53}(.*)', '$1' # get inner tar file name
Expand-7zipArchive -Path "$DestinationPath\$TarFile" -DestinationPath $DestinationPath -ExtractDir $ExtractDir -Removal
} else {
abort "Failed to list files in $Path.`nNot a 7-Zip supported archive file."
Expand Down

0 comments on commit cd6d31d

Please sign in to comment.