Skip to content

Commit 6816230

Browse files
authored
Fix jenv crashing silently
This fixes two issues: 1. On error, the script was closing the command prompt so we couldn't even see the error output. 2. The logic was incorrect, causing the script to close if `pwsh.exe` didn't exist but `powershell.exe` did.
1 parent 5a04051 commit 6816230

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jenv.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ where /q pwsh.exe
55
IF ERRORLEVEL 1 (
66
where /q powershell.exe
77
IF ERRORLEVEL 1 (
8-
set ps=powershell.exe
9-
) ELSE (
108
echo Neither pwsh.exe nor powershell.exe was found in your path.
119
echo Please install powershell it is required
12-
exit
10+
exit /B
11+
) ELSE (
12+
set ps=powershell.exe
1313
)
1414
) ELSE (
1515
set ps=pwsh.exe
@@ -37,4 +37,4 @@ if exist jenv.use.tmp (
3737
set JENVUSE=%%x
3838
)
3939
del -f jenv.use.tmp
40-
)
40+
)

0 commit comments

Comments
 (0)