Add helper scripts to open in VS Code with proper SDK (#4523)

This commit is contained in:
Juan Hoyos 2024-02-23 13:06:10 -08:00 коммит произвёл GitHub
Родитель dd431c607a
Коммит e1bda90d48
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 29 добавлений и 3 удалений

Просмотреть файл

@ -6,15 +6,14 @@ set "SLN_OR_PROJ=%~dp0diagnostics.sln"
set "DOTNET_ROOT=%SDK_LOC%"
set "DOTNET_ROOT(x86)=%SDK_LOC%\x86"
set DOTNET_MULTILEVEL_LOOKUP=0
set "DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=%DOTNET_ROOT%"
set PATH=%DOTNET_ROOT%;%PATH%
:: Restore before doing this
if not exist "%DOTNET_ROOT%\dotnet.exe" (
echo [ERROR] SDK has not yet been installed.
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
echo [ERROR] .NET Core has not yet been installed. Run `%~dp0dotnet.cmd` to install tools
exit /b 1
)

27
start-vscode.cmd Normal file
Просмотреть файл

@ -0,0 +1,27 @@
@echo off
setlocal enabledelayedexpansion
set "SDK_LOC=%~dp0.dotnet"
set "DOTNET_ROOT=%SDK_LOC%"
set "DOTNET_ROOT(x86)=%SDK_LOC%\x86"
set "DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=%DOTNET_ROOT%"
set "PATH=%DOTNET_ROOT%;%PATH%"
:: Restore before doing this
SET folder=%~1
IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
echo [ERROR] .NET Core has not yet been installed. Run `%~dp0dotnet.cmd` to install tools
exit /b 1
)
IF "%folder%"=="" (
code .
) else (
code "%folder%"
)
exit /b 1