From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Fri, 23 Feb 2024 21:06:10 +0000 (-0800) Subject: Add helper scripts to open in VS Code with proper SDK (#4523) X-Git-Tag: accepted/tizen/unified/20241231.014852~40^2~188 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1bda90d486b5cd17d8e51355891e1d8e8b065fc;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Add helper scripts to open in VS Code with proper SDK (#4523) --- diff --git a/start-vs.cmd b/start-vs.cmd index fd74f732f..da6fafa47 100644 --- a/start-vs.cmd +++ b/start-vs.cmd @@ -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 ) diff --git a/start-vscode.cmd b/start-vscode.cmd new file mode 100644 index 000000000..8747d825e --- /dev/null +++ b/start-vscode.cmd @@ -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