pull/51/head
lifei6671 2017-05-30 20:46:00 +08:00
parent 35f0ba1038
commit 41e19269e2
2 changed files with 15 additions and 1 deletions

View File

@ -10,10 +10,12 @@ environment:
- tbs_arch: "x86"
tbs_tools: "mingw"
tbs_static_runtime: 1
GOARCH: 386
- tbs_arch: "x64"
tbs_tools: "mingw"
tbs_static_runtime: 1
GOARCH: amd64
build: false
deploy: true
@ -39,8 +41,13 @@ install:
- go env
- go get -d ./...
build_script:
- if [%tbs_tools%]==[mingw] if [%tbs_arch%]==[x86] SET PATH=C:\mingw32\bin;%PATH%
- if [%tbs_tools%]==[mingw] if [%tbs_arch%]==[x64] SET PATH=C:\mingw64\bin;%PATH%
- go build -v -o "godoc_windows_%GOARCH%.exe" -ldflags="-w -X github.com/lifei6671/godoc/conf.VERSION=%APPVEYOR_REPO_TAG_NAME% -X 'github.com/lifei6671/godoc/conf.BUILD_TIME=`date`' -X 'conf.GO_VERSION=`github.com/lifei6671/godoc/go version`'"
test_script:
- go build -x -v -tags "pam" -ldflags "-w"
- godoc_windows_%GOARCH%.exe version
notifications:
- provider: Email

View File

@ -28,6 +28,13 @@ func Install() {
}
}
func Version() {
if len(os.Args) >= 2 && os.Args[1] == "version" {
fmt.Println(conf.VERSION)
os.Exit(0)
}
}
//初始化数据
func initialization() {