Skip to content

Commit 2d941a7

Browse files
committed
Fix path setting when jenv isn't installed
1 parent dae876d commit 2d941a7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/jenv.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Import-Module $PSScriptRoot\jenv-autoscan.psm1 -Force
5252

5353
#region Installation
5454
# TODO: Check for autoupdates
55-
$JENV_VERSION = "v2.2.0"
55+
$JENV_VERSION = "v2.2.1"
5656

5757
#region Remove any java versions from path
5858
$userPath = [System.Environment]::GetEnvironmentVariable("PATH", "User").split(";", [System.StringSplitOptions]::RemoveEmptyEntries)
@@ -63,10 +63,13 @@ $jenvPaths = (Get-Command jenv -All).source
6363
if ($jenvPaths.Length -gt 0) {
6464
Write-Host "JEnv is changing your environment variables. This process could take longer but it happens only when a jenv executable is found in your path"
6565
# Remove all jenvs from path
66-
$userPath = ($userPath | Where-Object { !$jenvPaths.Contains($_ + "\jenv.bat") } ) -join ";"
67-
$systemPath = ($systemPath | Where-Object { !$jenvPaths.Contains($_ + "\jenv.bat") } ) -join ";"
66+
$userPath = ($userPath | Where-Object { !$jenvPaths.Contains($_ + "\jenv.bat") } )
67+
$systemPath = ($systemPath | Where-Object { !$jenvPaths.Contains($_ + "\jenv.bat") } )
6868
}
6969

70+
$userPath = $userPath -join ";"
71+
$systemPath = $systemPath -join ";"
72+
7073
# Add JEnv to the beginning of the system path
7174
$currentJenvPath = (get-item $PSScriptRoot).parent.fullname
7275
$systemPath = $currentJenvPath + ";" + $systemPath

0 commit comments

Comments
 (0)