代码拉取完成,页面将自动刷新
ifndef GOBIN
ifeq ($(OS),Windows_NT)
GOBIN := $(shell cmd /C "echo %GOPATH%| cut -d';' -f1")
GOBIN := $(subst \,/,$(GOBIN))/bin
else
GOBIN := $(shell echo $$GOPATH | cut -d':' -f1 )/bin
endif
endif
ifeq ($(OS),Windows_NT)
EXE := srclib.exe
else
EXE := srclib
endif
MAKEFLAGS+=--no-print-directory
.PHONY: default install srclib release upload-release check-release test
default: govendor install
install: srclib
srclib: ${GOBIN}/${EXE}
${GOBIN}/${EXE}: $(shell /usr/bin/find . -type f -and -name '*.go')
go install ./cmd/srclib
govendor:
go get github.com/kardianos/govendor
govendor sync
release: upload-release check-release
upload-release:
@bash -c 'if [[ "$(V)" == "" ]]; then echo Must specify version: make release V=x.y.z; exit 1; fi'
go get github.com/laher/goxc
goxc -q -pv="$(V)"
git tag v$(V)
git push --tags
check-release:
@bash -c 'if [[ "$(V)" == "" ]]; then echo Must specify version: make release V=x.y.z; exit 1; fi'
@rm -rf /tmp/srclib-$(V).gz
curl -Lo /tmp/srclib-$(V).gz "https://srclib-release.s3.amazonaws.com/srclib/$(V)/$(shell go env GOOS)-$(shell go env GOARCH)/srclib.gz"
cd /tmp && gunzip -f srclib-$(V).gz && chmod +x srclib-$(V)
echo; echo
/tmp/srclib-$(V) version
echo; echo
@echo Released srclib $(V)
test:
go test -race -v $(go list ./... | grep -v /vendor/)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。