1 Star 0 Fork 636

甜橙/gf

forked from John/gf 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Makefile 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
Starccck 提交于 2023-04-24 21:50 . correct makefile (#2597)
SHELL := /bin/bash
.PHONY: tidy
tidy:
$(eval files=$(shell find . -name go.mod))
@set -e; \
for file in ${files}; do \
goModPath=$$(dirname $$file); \
cd $$goModPath; \
go mod tidy; \
cd -; \
done
.PHONY: lint
lint:
golangci-lint run
# make version to=v2.4.0
.PHONY: version
version:
$(eval files=$(shell find . -name go.mod))
@set -e; \
newVersion=$(to); \
echo "The version will be set to $$newVersion"; \
if [[ $$newVersion =~ "v" ]]; then \
latestVersion=$$newVersion; \
echo "package gf" > version.go; \
echo "" >> version.go; \
echo "const (" >> version.go; \
echo -e "\t// VERSION is the current GoFrame version." >> version.go; \
echo -e "\tVERSION = \"$$latestVersion\"" >> version.go; \
echo ")" >> version.go; \
else \
latestVersion=latest; \
fi; \
for file in ${files}; do \
goModPath=$$(dirname $$file); \
if [[ $$goModPath =~ "./contrib" || $$goModPath =~ "./cmd/gf" || $$goModPath =~ "./example" ]]; then \
echo "" ; \
echo "processing dir: $$goModPath"; \
cd $$goModPath; \
go mod tidy; \
go list -f "{{if and (not .Indirect) (not .Main)}}{{.Path}}@$$latestVersion{{end}}" -m all | grep "^github.com/gogf/gf/contrib" | xargs -L1 go get -v; \
go get -v github.com/gogf/gf/v2@$$latestVersion; \
go mod tidy; \
cd -; \
fi \
done
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/stcaaa/gf.git
[email protected]:stcaaa/gf.git
stcaaa
gf
gf
master

搜索帮助