Skip to content

Commit e35ff31

Browse files
committed
fix(decompress): Check .zst first
And also trim `\` in `-DestinationPath`
1 parent af7a6f6 commit e35ff31

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

lib/decompress.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ function Expand-ZstdArchive {
143143
)
144144
$ZstdPath = Get-HelperPath -Helper Zstd
145145
$LogPath = "$(Split-Path $Path)\zstd.log"
146+
$DestinationPath = $DestinationPath.TrimEnd("\")
146147
ensure $DestinationPath | Out-Null
147-
$ArgList = @('-d', "`"$Path`"", '--output-dir-flat', "`"$DestinationPath`"")
148+
$ArgList = @('-d', "`"$Path`"", '--output-dir-flat', "`"$DestinationPath`"", "-v")
148149
if ($Switches) {
149150
$ArgList += (-split $Switches)
150151
}
@@ -164,7 +165,7 @@ function Expand-ZstdArchive {
164165
}
165166
if ($IsTar) {
166167
# Check for tar
167-
$TarFile = Get-ChildItem -Path $DestinationPath -Filter '*.tar'
168+
$TarFile = (strip_ext $Path)
168169
Expand-7zipArchive -Path "$TarFile" -DestinationPath $DestinationPath -ExtractDir $ExtractDir -Removal
169170
}
170171
if ($Removal) {

lib/install.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,10 +596,10 @@ function dl_urls($app, $version, $manifest, $bucket, $architecture, $dir, $use_c
596596
} else {
597597
$extract_fn = 'Expand-MsiArchive'
598598
}
599+
} elseif(Test-ZstdRequirement -File $fname) { # Zstd first
600+
$extract_fn = 'Expand-ZstdArchive'
599601
} elseif(Test-7zipRequirement -File $fname) { # 7zip
600602
$extract_fn = 'Expand-7zipArchive'
601-
} elseif(Test-ZstdRequirement -File $fname) { # Zstd
602-
$extract_fn = 'Expand-ZstdArchive'
603603
}
604604

605605
if($extract_fn) {

0 commit comments

Comments
 (0)