From b68c737cf4a2d5217cfe03e7940e8584a67982f6 Mon Sep 17 00:00:00 2001 From: Luke Sampson Date: Thu, 17 Jul 2014 09:06:43 +1000 Subject: [PATCH] fix for #129 --- lib/install.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/install.ps1 b/lib/install.ps1 index 583a467b..852ecd1b 100644 --- a/lib/install.ps1 +++ b/lib/install.ps1 @@ -202,10 +202,12 @@ function dl_urls($app, $version, $manifest, $architecture, $dir) { #cp "$dir\_scoop_extract\$extract_dir\*" "$dir\$extract_to" -r -force -ea stop movedir "$dir\_scoop_extract\$extract_dir" "$dir\$extract_to" - try { - rm -r -force "$dir\_scoop_extract" -ea stop - } catch [system.io.pathtoolongexception] { - cmd /c "rmdir /s /q $dir\_scoop_extract" + if(test-path "$dir\_scoop_extract") { # might have been moved by movedir + try { + rm -r -force "$dir\_scoop_extract" -ea stop + } catch [system.io.pathtoolongexception] { + cmd /c "rmdir /s /q $dir\_scoop_extract" + } } rm "$dir\$fname"