From 9383457518f2fe882054e40cf518f8829fcf7cc3 Mon Sep 17 00:00:00 2001 From: shreyamalviya Date: Wed, 28 Apr 2021 13:32:30 +0530 Subject: [PATCH] Modify Windows deployment script to check $env:SKIP before adding swimm-verify to it --- deployment_scripts/deploy_windows.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deployment_scripts/deploy_windows.ps1 b/deployment_scripts/deploy_windows.ps1 index 3e10c365b..46f2fb0f4 100644 --- a/deployment_scripts/deploy_windows.ps1 +++ b/deployment_scripts/deploy_windows.ps1 @@ -25,7 +25,15 @@ function Configure-precommit([String] $git_repo_dir) Pop-Location # Set env variable to skip Swimm verification during pre-commit, Windows not supported yet - [System.Environment]::SetEnvironmentVariable('SKIP','swimm-verify',[System.EnvironmentVariableTarget]::User) + $skipValue = [System.Environment]::GetEnvironmentVariable('SKIP', [System.EnvironmentVariableTarget]::User) + if ($skipValue) { # if `SKIP` is not empty + if (-Not ($skipValue -split ',' -contains 'swimm-verify')) { # if `SKIP` doesn't already have "swimm-verify" + [System.Environment]::SetEnvironmentVariable('SKIP', $env:SKIP + ',swimm-verify', [System.EnvironmentVariableTarget]::User) + } + } + else { + [System.Environment]::SetEnvironmentVariable('SKIP', 'swimm-verify', [System.EnvironmentVariableTarget]::User) + } Write-Output "Pre-commit successfully installed" }