Skip to content

Commit

Permalink
Tools/fsi.bat: add error handling
Browse files Browse the repository at this point in the history
Otherwise we would get the following error when running
configure.bat in geewallet (after submodule population):

```
'""' is not recognized as an internal or external command,
operable program or batch file.
```
  • Loading branch information
knocte committed Apr 12, 2024
1 parent a0a5c67 commit e0c0b11
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Tools/fsi.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
@ECHO OFF

FOR /f "tokens=* delims=" %%A in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Component.FSharp -find **\fsi.exe') do set RUNNER=%%A
SET "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
SET "INSTALL_MSG=Please install .NET v6, or higher; or Visual Studio."

ECHO checking for '%VSWHERE%'...
IF NOT EXIST "%VSWHERE%" (
echo:
echo Tool vswhere.exe not found.
echo %INSTALL_MSG%
exit /b 1
)

ECHO checking for fsi.exe...
FOR /f "tokens=* delims=" %%A in ('"%VSWHERE%" -latest -requires Microsoft.VisualStudio.Component.FSharp -find **\fsi.exe') do set RUNNER=%%A

IF "%RUNNER%"=="" (
echo:
echo F# not found.
echo %INSTALL_MSG%
exit /b 1
)

"%RUNNER%" --define:LEGACY_FRAMEWORK %*

0 comments on commit e0c0b11

Please sign in to comment.