fix: template substitions

This commit is contained in:
Felipe M 2025-07-30 17:44:22 +02:00
parent dee239a3d4
commit 5df921238e
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
3 changed files with 8 additions and 8 deletions

View file

@ -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/.)

View file

@ -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))

View file

@ -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)
}