mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-09-20 20:35:49 +00:00
7zip decompress: allow recursive extract to fail with warning instead of failure
This commit is contained in:
+6
-1
@@ -13,7 +13,12 @@ function file_requires_7zip($fname) {
|
||||
function extract_7zip($path, $to, $recurse) {
|
||||
if(!$recurse) { write-host "extracting..." -nonewline }
|
||||
$output = 7z x "$path" -o"$to" -y
|
||||
if($lastexitcode -ne 0) { abort "exit code was $lastexitcode" }
|
||||
if($lastexitcode -ne 0) {
|
||||
if($recurse) {
|
||||
warn "couldn't extract $path, continuing"; return
|
||||
}
|
||||
abort "exit code was $lastexitcode"
|
||||
}
|
||||
|
||||
# recursively extract files, e.g. for .tar.gz
|
||||
$output | sls '^Extracting\s+(.*)$' | % {
|
||||
|
||||
Reference in New Issue
Block a user