diff --git a/hack/hack-cli.mk b/hack/hack-cli.mk index 7ba0d72..ea10b69 100644 --- a/hack/hack-cli.mk +++ b/hack/hack-cli.mk @@ -10,10 +10,5 @@ cli: # Check and install CLI tool. -.PHONY: cli.install -cli.install: - @set -e; \ - gf -v > /dev/null 2>&1 || if [[ "$?" -ne "0" ]]; then \ - echo "GoFame CLI is not installed, start proceeding auto installation..."; \ - make cli; \ - fi; \ No newline at end of file +$(GOPATH)/bin/gf: + @make cli \ No newline at end of file diff --git a/hack/hack.mk b/hack/hack.mk index b496dae..7855428 100644 --- a/hack/hack.mk +++ b/hack/hack.mk @@ -2,38 +2,38 @@ include ../../hack/hack-cli.mk # Update GoFrame and its CLI to latest stable version. .PHONY: up -up: cli.install +up: $(GOPATH)/bin/gf @gf up -a # Build binary using configuration from hack/config.yaml. .PHONY: build -build: cli.install +build: $(GOPATH)/bin/gf @gf build -ew # Parse api and generate controller/sdk. .PHONY: ctrl -ctrl: cli.install +ctrl: $(GOPATH)/bin/gf @gf gen ctrl # Generate Go files for DAO/DO/Entity. .PHONY: dao -dao: cli.install +dao: $(GOPATH)/bin/gf @gf gen dao # Parse current project go files and generate enums go file. .PHONY: enums -enums: cli.install +enums: $(GOPATH)/bin/gf @gf gen enums # Generate Go files for Service. .PHONY: service -service: cli.install +service: $(GOPATH)/bin/gf @gf gen service # Build docker image. .PHONY: image -image: cli.install +image: $(GOPATH)/bin/gf $(eval _TAG = $(shell git describe --dirty --always --tags --abbrev=8 --match 'v*' | sed 's/-/./2' | sed 's/-/./2')) ifneq (, $(shell git status --porcelain 2>/dev/null)) $(eval _TAG = $(_TAG).dirty) @@ -66,10 +66,10 @@ deploy: # Parsing protobuf files and generating go files. .PHONY: pb -pb: cli.install +pb: $(GOPATH)/bin/gf @gf gen pb # Generate protobuf files for database tables. .PHONY: pbentity -pbentity: cli.install +pbentity: $(GOPATH)/bin/gf @gf gen pbentity \ No newline at end of file