mirror of https://github.com/hashicorp/consul
Make modulename param so build.bat can be generalized and used for any go project
parent
c908cfb0c0
commit
7b337b8a36
11
build.bat
11
build.bat
|
@ -2,16 +2,17 @@
|
||||||
|
|
||||||
REM Download Mingw 64 on Windows from http://win-builds.org/download.html
|
REM Download Mingw 64 on Windows from http://win-builds.org/download.html
|
||||||
|
|
||||||
set GOARCH=%1
|
set GOARCH=%2
|
||||||
IF "%1" == "" (set GOARCH=amd64)
|
IF "%2" == "" (set GOARCH=amd64)
|
||||||
|
set MODULENAME=%1
|
||||||
set ORG_PATH=github.com\hashicorp
|
set ORG_PATH=github.com\hashicorp
|
||||||
set REPO_PATH=%ORG_PATH%\consul
|
set REPO_PATH=%ORG_PATH%\%MODULENAME%
|
||||||
|
|
||||||
set GOPATH=%cd%\gopath
|
set GOPATH=%cd%\gopath
|
||||||
|
|
||||||
rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul
|
rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul
|
||||||
mkdir %GOPATH%\src\%ORG_PATH% 2>nul
|
mkdir %GOPATH%\src\%ORG_PATH% 2>nul
|
||||||
go get -u .\...
|
go get .\...
|
||||||
mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul
|
mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul
|
||||||
|
|
||||||
%GOROOT%\bin\go build -o bin\%GOARCH%\consul.exe %REPO_PATH%
|
%GOROOT%\bin\go build -o bin\%GOARCH%\%MODULENAME%.exe %REPO_PATH%
|
Loading…
Reference in New Issue