Skip to content

Instantly share code, notes, and snippets.

@shashfrankenstien
Created February 7, 2020 06:06
Show Gist options
  • Save shashfrankenstien/59fe1871a3a926a6beea90dbd9e3bc3b to your computer and use it in GitHub Desktop.
Save shashfrankenstien/59fe1871a3a926a6beea90dbd9e3bc3b to your computer and use it in GitHub Desktop.
@echo off
echo %1
set make=%~dpnx0
set EXE=AppName.exe
if [%1]==[build] goto :BUILD
if [%1]==[install] goto :INSTALL
if [%1]==[uninstall] goto :UNINSTALL
if [%1]==[clean] goto :CLEAN
goto :DONE
:BUILD
mkdir build
cd src
go build -o ..\build\%EXE%
cd ..
goto :DONE
:CLEAN
rm -rf build
goto :DONE
:INSTALL
%make% build && cp build\%EXE% %GOROOT%\bin && %make% clean
goto :DONE
:UNINSTALL
rm %GOROOT%\bin\%EXE%
goto :DONE
:DONE
echo done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment