From 24f6a2f28a567da4f71f2bb6bc5d606ca5e4beee Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 23 Jan 2018 12:37:01 +0100 Subject: [PATCH] Provisioning on windows: Fix deletion of utils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want to be able to re-provision machiens without errors. The directory doesn't exist on the machine any more. Change-Id: I2b5b92037492e51aeb4d041d62f371b8546cb0a3 Reviewed-by: Tony Sarajärvi --- .../provisioning/common/windows/windows_removethemall.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/coin/provisioning/common/windows/windows_removethemall.ps1 b/coin/provisioning/common/windows/windows_removethemall.ps1 index 0e584900..96c448e3 100644 --- a/coin/provisioning/common/windows/windows_removethemall.ps1 +++ b/coin/provisioning/common/windows/windows_removethemall.ps1 @@ -56,6 +56,8 @@ Function Remove-Path { } # Remove Android sdk and ndk -dir c:\utils\android* | ForEach { Rename-Item $_ $_"-deleted" } -[Environment]::SetEnvironmentVariable("ANDROID_NDK_HOME",$null,"User") -[Environment]::SetEnvironmentVariable("ANDROID_SDK_HOME",$null,"User") +If (Test-Path "c:\utils") { + dir c:\utils\android* | ForEach { Rename-Item $_ $_"-deleted" } + [Environment]::SetEnvironmentVariable("ANDROID_NDK_HOME",$null,"User") + [Environment]::SetEnvironmentVariable("ANDROID_SDK_HOME",$null,"User") +}