From 1f0531f65e18b9dda67476f636f9bc1bc30ec03d Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Sun, 8 Mar 2015 22:08:42 -0700 Subject: [PATCH] Update dnvm. --- build/dnvm.ps1 | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/build/dnvm.ps1 b/build/dnvm.ps1 index 6760f1d56d..45ec9daa04 100644 --- a/build/dnvm.ps1 +++ b/build/dnvm.ps1 @@ -513,20 +513,24 @@ function Change-Path() { $newPath = $prependPath foreach($portion in $existingPaths.Split(';')) { - $skip = $portion -eq "" - foreach($removePath in $removePaths) { - $removePrefix = if($removePath.EndsWith("\")) { $removePath } else { "$removePath\" } + if(![string]::IsNullOrWhiteSpace($portion)) { + $skip = $portion -eq "" + foreach($removePath in $removePaths) { + if(![string]::IsNullOrWhiteSpace($removePath)) { + $removePrefix = if($removePath.EndsWith("\")) { $removePath } else { "$removePath\" } - if ($removePath -and (($portion -eq $removePath) -or ($portion.StartsWith($removePrefix)))) { - _WriteDebug " Removing '$portion' because it matches '$removePath'" - $skip = $true + if ($removePath -and (($portion -eq $removePath) -or ($portion.StartsWith($removePrefix)))) { + _WriteDebug " Removing '$portion' because it matches '$removePath'" + $skip = $true + } + } } - } - if (!$skip) { - if(![String]::IsNullOrWhiteSpace($newPath)) { - $newPath += ";" + if (!$skip) { + if(![String]::IsNullOrWhiteSpace($newPath)) { + $newPath += ";" + } + $newPath += $portion } - $newPath += $portion } } return $newPath