16 lines
523 B
Makefile
16 lines
523 B
Makefile
|
|
# Keep the CLI version aligned with github.com/gogf/gf/v2 in go.mod.
|
|
GF_CLI_VERSION ?= v2.9.6
|
|
GF_CMD ?= go run github.com/gogf/gf/cmd/gf/v2@$(GF_CLI_VERSION)
|
|
|
|
# Install the pinned CLI tool for developers who want a local executable.
|
|
.PHONY: cli
|
|
cli:
|
|
@go install github.com/gogf/gf/cmd/gf/v2@$(GF_CLI_VERSION)
|
|
|
|
# Validate the pinned CLI can run. Generation targets invoke GF_CMD directly,
|
|
# so a different gf executable earlier on PATH cannot silently take over.
|
|
.PHONY: cli.install
|
|
cli.install:
|
|
@$(GF_CMD) -v >/dev/null
|