Skip to content

Commit 4d36cbd

Browse files
chawyehsuniheaven
andauthored
fix(decompress): Fix tarball decompression (#4813)
Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
1 parent 635ae17 commit 4d36cbd

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Bug Fixes
44

5-
- **shim:** Manipulating shims with UTF8 encoding ([#4791](https://github.com/ScoopInstaller/Scoop/issues/4791))
5+
- **shim:** Manipulating shims with UTF8 encoding ([#4791](https://github.com/ScoopInstaller/Scoop/issues/4791), [#4813](https://github.com/ScoopInstaller/Scoop/issues/4813))
66
- **shim:** Correctly quote $@ in sh->ps1 shims ([#4808](https://github.com/ScoopInstaller/Scoop/issues/4808))
77
- **installed:** If no `$global`, check both local and global installed ([#4798](https://github.com/ScoopInstaller/Scoop/issues/4798))
88
- **scoop-prefix:** Fix typo that breaks global installed apps ([#4795](https://github.com/ScoopInstaller/Scoop/issues/4795))

lib/decompress.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ function Expand-7zipArchive {
5555
# Check for tar
5656
$Status = Invoke-ExternalCommand $7zPath @('l', "`"$Path`"") -LogPath $LogPath
5757
if ($Status) {
58-
$TarFile = (Get-Content -Path $LogPath)[-5] -replace '.{53}(.*)', '$1' # get inner tar file name
58+
# get inner tar file name
59+
$TarFile = (Select-String -Path $LogPath -Pattern '[^ ]*tar$').Matches.Value
5960
Expand-7zipArchive -Path "$DestinationPath\$TarFile" -DestinationPath $DestinationPath -ExtractDir $ExtractDir -Removal
6061
} else {
6162
abort "Failed to list files in $Path.`nNot a 7-Zip supported archive file."

0 commit comments

Comments
 (0)