startvscode.cmd 684 B

1234567891011121314151617181920212223242526272829
  1. @ECHO OFF
  2. SETLOCAL
  3. :: This command launches a Visual Studio Code with environment variables required to use a local version of the .NET SDK.
  4. :: This tells .NET to use the same dotnet.exe that build scripts use
  5. SET DOTNET_ROOT=%~dp0.dotnet
  6. SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86
  7. :: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
  8. SET PATH=%DOTNET_ROOT%;%PATH%
  9. :: Sets TFW for Visual Studio Code usage
  10. SET TARGET=net10.0
  11. SET folder=%~1
  12. IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
  13. echo .NET has not yet been installed. Run `%~dp0restore.cmd` to install tools
  14. exit /b 1
  15. )
  16. IF "%folder%"=="" (
  17. code .
  18. ) else (
  19. code "%folder%"
  20. )
  21. exit /b 1