Skip to content

Commit

Permalink
fix(Makefile): fix issue #2, #3
Browse files Browse the repository at this point in the history
Fixes #2,#3
  • Loading branch information
windvalley committed Jul 9, 2023
1 parent 64c67a0 commit 4dc4041
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## v0.11.0

### Added

- 新增 redis 常用工具库: `internal/pkg/rediscache`)
- 新增 kafka 客户端以及使用示例(`internal/pkg/kafka` )

### Fixed

- `Makefile`
- 优化`make cli.install`, 解决因官方 gf cli 升级可能导致的本项目编译报错问题: [#2](https://github.com/windvalley/gf2-demo/issues/2), [#3](https://github.com/windvalley/gf2-demo/issues/3)

## v0.10.0

### Added
Expand Down
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ CLI_PATH = cmd/gf2-demo-cli/${CLI_NAME}.go

VERSION = $(shell git describe --tags --always --match='v*')

# Be same as gf version in go.mod.
GF_VERSION = v2.4.2

SED = sed
ifeq ($(shell uname), Darwin)
SED = gsed
Expand Down Expand Up @@ -57,7 +60,7 @@ endif
.PHONY: cli
cli:
@set -e; \
wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_$(shell go env GOOS)_$(shell go env GOARCH) && \
wget -O gf https://github.com/gogf/gf/releases/download/${GF_VERSION}/gf_$(shell go env GOOS)_$(shell go env GOARCH) && \
chmod +x gf && \
./gf install -y && \
rm ./gf
Expand All @@ -66,10 +69,16 @@ cli:
# Check and install CLI tool
.PHONY: cli.install
cli.install:
@echo "******** install gf cli ********"
@set -e; \
gf -v > /dev/null 2>&1 || if [[ "$?" -ne "0" ]]; then \
if ! gf -v >/dev/null 2>&1; then \
echo "GoFame CLI is not installed, start proceeding auto installation..."; \
make cli; \
elif [[ $$(gf -v|awk -F: '/GF Version:/{print $$2}' | awk '{gsub(/^[[:space:]]+|[[:space:]]+$$/, "")}1') != ${GF_VERSION} ]];then \
echo "GoFame CLI version is not equal to ${GF_VERSION}, start proceeding auto installation..."; \
make cli; \
else \
echo "GoFame CLI is already installed and version is right: $(GF_VERSION)"; \
fi;

# Check and install golangci-lint tool
Expand All @@ -89,7 +98,7 @@ lint: lint.install
.PHONY: dao
dao: cli.install
@echo "******** gf gen dao ********"
@GF_GCFG_FILE=config.yaml gf gen dao
@gf gen dao

## service: Generate Go files for Service
.PHONY: service
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module gf2-demo
go 1.15

require (
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.0
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.2
github.com/gogf/gf/contrib/nosql/redis/v2 v2.4.2
github.com/gogf/gf/v2 v2.4.2
github.com/satori/go.uuid v1.2.0
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.0 h1:VNnOFQ44FGCrNdIE6zaizWilgr6G5n1YQ6JkMvtbJLA=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.0/go.mod h1:hS3/ACE9qeQOe9fCIddOgE0PJoYJcYEv52/cvhxfxeU=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.2 h1:9FHmlbPTG+3nSGKldLomJazIStV8LGfooshJxdqraFA=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.2/go.mod h1:j+0YZaon7I/pmY3oM0kdEcFtYmQV2EuH7pT55+mDNro=
github.com/gogf/gf/contrib/nosql/redis/v2 v2.4.2 h1:4iB+rt/mWCGwQEbBL5nJ7jsQTGzCXbZfzLgzcw/a3CY=
github.com/gogf/gf/contrib/nosql/redis/v2 v2.4.2/go.mod h1:Hb73HOygHtW9e+BhHhEWVFR7aUwIVDtJ8xYXWeSIIAw=
github.com/gogf/gf/v2 v2.4.0/go.mod h1:tsbmtwcAl2chcYoq/fP9W2FZf06aw4i89X34nbSHo9Y=
github.com/gogf/gf/v2 v2.4.2 h1:31ekx+YKisG84/iEC2Ih6lB+g92+sB9R+VrfIbqfpac=
github.com/gogf/gf/v2 v2.4.2/go.mod h1:tsbmtwcAl2chcYoq/fP9W2FZf06aw4i89X34nbSHo9Y=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down
2 changes: 1 addition & 1 deletion hack/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gfcli:
# NOTE:
# 1) `version` was generated by `make build`, Do Not Edit
# 2) you should manage versions by `git tag vX.X.X`
version: v0.8.0
version: v0.10.0-2-g64c67a0

gen:
# doc: https://goframe.org/pages/viewpage.action?pageId=3673173
Expand Down

0 comments on commit 4dc4041

Please sign in to comment.