Scripts

Some scriptable shortcuts and tiny utilities to make life easier using batch scripting. These usually live within the project folder and committed to repository along with the project. You can create shortcuts on your desktop for quick access.

Table of Contents


Tortoise SVN Commit

  • Opens up the Tortoise SVN commit dialog in the given path, change the path to suit your needs
  • Requires tortoiseproc.exe to be in the environment variables, alternatively use SET path="PATH TO tortoiseproc.exe";%path%
@ECHO OFF
tortoiseproc.exe /command:commit ^
                 /path "..\"


Hugo Web Dev Environment Shortcut

Starts the hugo server, opens up the sublime text and the browser on the localhost with hugo port. Geared towards my specific needs.

@ECHO OFF

REM start hugo server on sarpersoher.com
START hugo server

REM open sublime text
SET path="D:\app\Sublime Text 3";%path%
START sublime_text.exe

REM open browser with localhost.com:1313
START "" http://localhost:1313


Game Dev Environment Shortcut

  • Starts Unity and Jetbrains Rider with a specific project. Change the paths as needed. Can be used with other engines and IDE’s as long as they support command line arguments to lunch with a project path.
  • TIMEOUT commands are added for the cold start of both applications with a big project takes a ton of time if they are ran simultaneously so it waits an arbitrary amount of time before moving on to opening the next application.
@ECHO OFF

ECHO Adding Unity and Rider to Path
SET path=D:\dev\Unity\Editor;"C:\Users\sarpe\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\JetBrains Toolbox";%path%

ECHO Starting Unity
START Unity -projectPath "D:\project\defender3d\src"

TIMEOUT 30 /NOBREAK

ECHO Starting Rider
START Rider.lnk "D:\project\defender3d\src\src.sln"

TIMEOUT 3 /NOBREAK


Drag APK to Install

  • Drag an APK on it and it will install it on the first connected Android device
  • adb must be in environment variables, alternatively use SET path="PATH TO ADB";%path%
@ECHO OFF
ECHO "%1"
adb install -r "%1"
PAUSE


LOC Counter

  • Requires tokei or loc or other similar commandline line counter programs.
  • Change the paths to each individual folders you want to count & print the loc, add more as needed
@ECHO OFF
ECHO -GAME CODE-
loc.exe "..\src\Assets\Defender3D\Scripts"

ECHO.
ECHO.

ECHO -AE NAMESPACE-
loc.exe "..\src\Assets\Plugins\AccidentalEmpireNamespace"
pause