.
This commit is contained in:
37
open-in-vs.bat
Normal file
37
open-in-vs.bat
Normal file
@@ -0,0 +1,37 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions
|
||||
rem Opens this Git repo in Visual Studio (solution at repo root = Git Changes works).
|
||||
rem Pattern for non-.NET cursor_projects: blank .sln next to .git + this launcher.
|
||||
|
||||
set "ROOT=%~dp0"
|
||||
if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%"
|
||||
set "SLN=%ROOT%\RIP_Help_system.sln"
|
||||
|
||||
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
if not exist "%VSWHERE%" (
|
||||
echo vswhere.exe not found. Install Visual Studio 2022 or 2026.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
set "DEVENV="
|
||||
rem Do not pass -products *: that includes SSMS, which vswhere then picks as "latest".
|
||||
for /f "usebackq delims=" %%I in (`"%VSWHERE%" -latest -prerelease -property productPath`) do set "DEVENV=%%I"
|
||||
if not defined DEVENV (
|
||||
echo Visual Studio not found.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if exist "%SLN%" (
|
||||
start "" "%DEVENV%" "%SLN%"
|
||||
) else (
|
||||
start "" "%DEVENV%" "%ROOT%"
|
||||
)
|
||||
|
||||
echo Opened in Visual Studio:
|
||||
echo %SLN%
|
||||
echo.
|
||||
echo Source Control plug-in must be Git, not VisualSVN:
|
||||
echo Tools ^> Options ^> Source Control ^> Plug-in Selection ^> Git
|
||||
echo Then: View ^> Git Changes -^> Commit -^> Push
|
||||
echo Do not click Create Git Repository — this folder already has .git
|
||||
exit /b 0
|
||||
Reference in New Issue
Block a user