Skip to content

Instantly share code, notes, and snippets.

@UpcraftLP
Last active October 26, 2021 09:18
Show Gist options
  • Save UpcraftLP/b3840e77860171ac07aa4d8c6f565dcf to your computer and use it in GitHub Desktop.
Save UpcraftLP/b3840e77860171ac07aa4d8c6f565dcf to your computer and use it in GitHub Desktop.
https://github.com/Academy-City/Railgun launch script (also includes vs code launch json)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Railgun",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/railgun-launch.bat",
"args": ["${relativeFile}"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
@echo off
cls
::set the main file path
SET "MAINFILE=%1"
SET "COMMAND=dotnet run --project=".\Railgun\Railgun.csproj" -- run "%MAINFILE%""
:: get railgun version
CALL :getVersion
SET githash=%_result%
echo Railgun @%githash%: %COMMAND%
echo.
CALL %COMMAND%
echo.
echo Program exited with code %ERRORLEVEL%
echo.
goto :EOF
:: ----------------------------------------------------------------------------
:getVersion
SETLOCAL
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --short HEAD`) DO (
SET githash=%%F
)
ENDLOCAL & SET "_result=%githash%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment