Refactor manifest command to use template-based field access
Replace individual subcommands (id, version, has_server, has_webapp) with a unified 'get {{.field_name}}' pattern that uses Go templates to access any field from the manifest JSON dynamically. - Update manifest.go to parse and execute Go templates against manifest data - Update makefile calls in _setup.mk and versioning.mk to use new syntax - Update help documentation to reflect template-based usage - Provides more flexibility for accessing any manifest field without code changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
18bfca1c2c
commit
0bc6d51b24
4 changed files with 27 additions and 29 deletions
|
@ -10,22 +10,22 @@ BUILD_TAG_LATEST = $(shell git describe --tags --match 'v*' --abbrev=0 2>/dev/nu
|
|||
BUILD_TAG_CURRENT = $(shell git tag --points-at HEAD)
|
||||
|
||||
# Extract the plugin id from the manifest.
|
||||
PLUGIN_ID ?= $(shell pluginctl manifest id)
|
||||
PLUGIN_ID ?= $(shell pluginctl manifest get '{{.id}}')
|
||||
ifeq ($(PLUGIN_ID),)
|
||||
$(error "Cannot parse id from $(MANIFEST_FILE)")
|
||||
endif
|
||||
|
||||
# Extract the plugin version from the manifest.
|
||||
PLUGIN_VERSION ?= $(shell pluginctl manifest version)
|
||||
PLUGIN_VERSION ?= $(shell pluginctl manifest get '{{.version}}')
|
||||
ifeq ($(PLUGIN_VERSION),)
|
||||
$(error "Cannot parse version from $(MANIFEST_FILE)")
|
||||
endif
|
||||
|
||||
# Determine if a server is defined in the manifest.
|
||||
HAS_SERVER ?= $(shell pluginctl manifest has_server)
|
||||
HAS_SERVER ?= $(shell pluginctl manifest get '{{.has_server}}')
|
||||
|
||||
# Determine if a webapp is defined in the manifest.
|
||||
HAS_WEBAPP ?= $(shell pluginctl manifest has_webapp)
|
||||
HAS_WEBAPP ?= $(shell pluginctl manifest get '{{.has_webapp}}')
|
||||
|
||||
# Determine if a /public folder is in use
|
||||
HAS_PUBLIC ?= $(wildcard public/.)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue