From e06fdf784fe10c9699ec0a6badd60412c0140215 Mon Sep 17 00:00:00 2001 From: Luke Sampson Date: Fri, 17 Jan 2014 08:51:15 +1000 Subject: [PATCH] abort if unzip fails --- lib/core.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core.ps1 b/lib/core.ps1 index 937dedad..add4ed40 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -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) {