mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-08-28 17:17:02 +00:00
abort if unzip fails
This commit is contained in:
+5
-1
@@ -65,7 +65,11 @@ function env($name,$global,$val='__get') {
|
||||
function unzip($path,$to) {
|
||||
if(!(test-path $path)) { abort "can't find $path to unzip"}
|
||||
add-type -assembly "System.IO.Compression.FileSystem"
|
||||
[io.compression.zipfile]::extracttodirectory($path,$to)
|
||||
try {
|
||||
[io.compression.zipfile]::extracttodirectory($path,$to)
|
||||
} catch {
|
||||
abort "unzip failed: $_"
|
||||
}
|
||||
}
|
||||
|
||||
function shim($path, $global, $name, $arg) {
|
||||
|
||||
Reference in New Issue
Block a user