Created
November 6, 2013 11:42
-
-
Save akavel/7334765 to your computer and use it in GitHub Desktop.
go-cmd.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
:: EXAMPLE: | |
:: set GOPATH=c:\gopath1;c:\gopath2 | |
:::::::: meat :::::::: | |
set GOROOT=%~dp0 | |
:: get first element of GOPATH | |
set _tmp=%GOPATH:*;=% | |
call set GOPATH0=%%GOPATH:%_tmp%=%% | |
set GOPATH0=%GOPATH0:;=% | |
mkdir %GOPATH0% > nul 2>&1 | |
:: add important folders to PATH | |
set PATH=%GOROOT%\bin;%GOPATH0%\bin;%PATH% | |
cmd /K "echo GOROOT=%GOROOT%" | |
endlocal | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment