From 5df921238eb649787c7f2e5033f04541d622c132 Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Wed, 30 Jul 2025 17:44:22 +0200 Subject: [PATCH] fix: template substitions --- assets/build/_setup.mk | 8 ++++---- assets/build/versioning.mk | 2 +- manifest.go | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/build/_setup.mk b/assets/build/_setup.mk index 9e694f8..91bcc00 100644 --- a/assets/build/_setup.mk +++ b/assets/build/_setup.mk @@ -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 get '{{.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 get '{{.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 get '{{.has_server}}') +HAS_SERVER ?= $(shell pluginctl manifest get '{{"{{"}}.HasServer{{"}}"}}') # Determine if a webapp is defined in the manifest. -HAS_WEBAPP ?= $(shell pluginctl manifest get '{{.has_webapp}}') +HAS_WEBAPP ?= $(shell pluginctl manifest get '{{"{{"}}.HasWebapp{{"}}"}}') # Determine if a /public folder is in use HAS_PUBLIC ?= $(wildcard public/.) diff --git a/assets/build/versioning.mk b/assets/build/versioning.mk index ca7a31a..439d992 100644 --- a/assets/build/versioning.mk +++ b/assets/build/versioning.mk @@ -4,7 +4,7 @@ # Used for semver bumping PROTECTED_BRANCH := master -APP_NAME := $(shell pluginctl manifest get '{{.id}}') +APP_NAME := $(shell pluginctl manifest get '{{"{{"}}.Id{{"}}"}}') CURRENT_VERSION := $(shell git describe --abbrev=0 --tags) VERSION_PARTS := $(subst ., ,$(subst v,,$(subst -rc, ,$(CURRENT_VERSION)))) MAJOR := $(word 1,$(VERSION_PARTS)) diff --git a/manifest.go b/manifest.go index c2ea165..1cee261 100644 --- a/manifest.go +++ b/manifest.go @@ -105,8 +105,8 @@ Options: --help, -h Show this help message Examples: - pluginctl manifest get '{{.id}}' # Get plugin ID - pluginctl manifest get '{{.version}}' # Get plugin version + pluginctl manifest get '{{.Id}}' # Get plugin ID + pluginctl manifest get '{{.Version}}' # Get plugin version pluginctl manifest apply # Generate server/webapp manifest files pluginctl manifest check # Validate manifest` @@ -146,7 +146,7 @@ Examples: } var buf bytes.Buffer - if err := tmpl.Execute(&buf, manifest); err != nil { + if err := tmpl.Execute(&buf, *manifest); err != nil { return fmt.Errorf("failed to execute template: %w", err) }