-
Notifications
You must be signed in to change notification settings - Fork 87
/
jenv.bat
46 lines (39 loc) · 1015 Bytes
/
jenv.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@echo off
rem # Check if powershell is in path
where /q pwsh
IF ERRORLEVEL 1 (
where /q powershell
IF ERRORLEVEL 1 (
echo Neither pwsh.exe nor powershell.exe was found in your path.
echo Please install powershell it is required
exit /B
) ELSE (
set ps=powershell
)
) ELSE (
set ps=pwsh
)
rem ps is the installed powershell
%ps% -executionpolicy remotesigned -File "%~dp0/src/jenv.ps1" %* --output
if exist jenv.home.tmp (
FOR /F "tokens=* delims=" %%x in (jenv.home.tmp) DO (
set JAVA_HOME=%%x
)
del -f jenv.home.tmp
)
if exist jenv.path.tmp (
FOR /F "tokens=* delims=" %%x in (jenv.path.tmp) DO (
set path=%%x
)
del -f jenv.path.tmp
)
if exist jenv.use.tmp (
FOR /F "tokens=* delims=" %%x in (jenv.use.tmp) DO (
if "%%x" == "remove" (
set "JENVUSE="
) ELSE (
set JENVUSE=%%x
)
)
del -f jenv.use.tmp
)