mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2025-12-12 11:06:34 +00:00
fix(decompress): Check .zst first
And also trim `\` in `-DestinationPath`
This commit is contained in:
@@ -143,8 +143,9 @@ function Expand-ZstdArchive {
|
|||||||
)
|
)
|
||||||
$ZstdPath = Get-HelperPath -Helper Zstd
|
$ZstdPath = Get-HelperPath -Helper Zstd
|
||||||
$LogPath = "$(Split-Path $Path)\zstd.log"
|
$LogPath = "$(Split-Path $Path)\zstd.log"
|
||||||
|
$DestinationPath = $DestinationPath.TrimEnd("\")
|
||||||
ensure $DestinationPath | Out-Null
|
ensure $DestinationPath | Out-Null
|
||||||
$ArgList = @('-d', "`"$Path`"", '--output-dir-flat', "`"$DestinationPath`"")
|
$ArgList = @('-d', "`"$Path`"", '--output-dir-flat', "`"$DestinationPath`"", "-v")
|
||||||
if ($Switches) {
|
if ($Switches) {
|
||||||
$ArgList += (-split $Switches)
|
$ArgList += (-split $Switches)
|
||||||
}
|
}
|
||||||
@@ -164,7 +165,7 @@ function Expand-ZstdArchive {
|
|||||||
}
|
}
|
||||||
if ($IsTar) {
|
if ($IsTar) {
|
||||||
# Check for tar
|
# Check for tar
|
||||||
$TarFile = Get-ChildItem -Path $DestinationPath -Filter '*.tar'
|
$TarFile = (strip_ext $Path)
|
||||||
Expand-7zipArchive -Path "$TarFile" -DestinationPath $DestinationPath -ExtractDir $ExtractDir -Removal
|
Expand-7zipArchive -Path "$TarFile" -DestinationPath $DestinationPath -ExtractDir $ExtractDir -Removal
|
||||||
}
|
}
|
||||||
if ($Removal) {
|
if ($Removal) {
|
||||||
|
|||||||
@@ -596,10 +596,10 @@ function dl_urls($app, $version, $manifest, $bucket, $architecture, $dir, $use_c
|
|||||||
} else {
|
} else {
|
||||||
$extract_fn = 'Expand-MsiArchive'
|
$extract_fn = 'Expand-MsiArchive'
|
||||||
}
|
}
|
||||||
|
} elseif(Test-ZstdRequirement -File $fname) { # Zstd first
|
||||||
|
$extract_fn = 'Expand-ZstdArchive'
|
||||||
} elseif(Test-7zipRequirement -File $fname) { # 7zip
|
} elseif(Test-7zipRequirement -File $fname) { # 7zip
|
||||||
$extract_fn = 'Expand-7zipArchive'
|
$extract_fn = 'Expand-7zipArchive'
|
||||||
} elseif(Test-ZstdRequirement -File $fname) { # Zstd
|
|
||||||
$extract_fn = 'Expand-ZstdArchive'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($extract_fn) {
|
if($extract_fn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user