Skip to content

Commit

Permalink
Fix jenv crashing silently
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
serg06 authored Mar 16, 2022
1 parent 5a04051 commit 6816230
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jenv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ where /q pwsh.exe
IF ERRORLEVEL 1 (
where /q powershell.exe
IF ERRORLEVEL 1 (
set ps=powershell.exe
) ELSE (
echo Neither pwsh.exe nor powershell.exe was found in your path.
echo Please install powershell it is required
exit
exit /B
) ELSE (
set ps=powershell.exe
)
) ELSE (
set ps=pwsh.exe
Expand Down Expand Up @@ -37,4 +37,4 @@ if exist jenv.use.tmp (
set JENVUSE=%%x
)
del -f jenv.use.tmp
)
)

0 comments on commit 6816230

Please sign in to comment.