fix: template substitions
This commit is contained in:
parent
dee239a3d4
commit
5df921238e
3 changed files with 8 additions and 8 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)
|
BUILD_TAG_CURRENT = $(shell git tag --points-at HEAD)
|
||||||
|
|
||||||
# Extract the plugin id from the manifest.
|
# Extract the plugin id from the manifest.
|
||||||
PLUGIN_ID ?= $(shell pluginctl manifest get '{{.id}}')
|
PLUGIN_ID ?= $(shell pluginctl manifest get '{{"{{"}}.Id{{"}}"}}')
|
||||||
ifeq ($(PLUGIN_ID),)
|
ifeq ($(PLUGIN_ID),)
|
||||||
$(error "Cannot parse id from $(MANIFEST_FILE)")
|
$(error "Cannot parse id from $(MANIFEST_FILE)")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Extract the plugin version from the manifest.
|
# Extract the plugin version from the manifest.
|
||||||
PLUGIN_VERSION ?= $(shell pluginctl manifest get '{{.version}}')
|
PLUGIN_VERSION ?= $(shell pluginctl manifest get '{{"{{"}}.Version{{"}}"}}')
|
||||||
ifeq ($(PLUGIN_VERSION),)
|
ifeq ($(PLUGIN_VERSION),)
|
||||||
$(error "Cannot parse version from $(MANIFEST_FILE)")
|
$(error "Cannot parse version from $(MANIFEST_FILE)")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Determine if a server is defined in the manifest.
|
# 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.
|
# 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
|
# Determine if a /public folder is in use
|
||||||
HAS_PUBLIC ?= $(wildcard public/.)
|
HAS_PUBLIC ?= $(wildcard public/.)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
# Used for semver bumping
|
# Used for semver bumping
|
||||||
PROTECTED_BRANCH := master
|
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)
|
CURRENT_VERSION := $(shell git describe --abbrev=0 --tags)
|
||||||
VERSION_PARTS := $(subst ., ,$(subst v,,$(subst -rc, ,$(CURRENT_VERSION))))
|
VERSION_PARTS := $(subst ., ,$(subst v,,$(subst -rc, ,$(CURRENT_VERSION))))
|
||||||
MAJOR := $(word 1,$(VERSION_PARTS))
|
MAJOR := $(word 1,$(VERSION_PARTS))
|
||||||
|
|
|
@ -105,8 +105,8 @@ Options:
|
||||||
--help, -h Show this help message
|
--help, -h Show this help message
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
pluginctl manifest get '{{.id}}' # Get plugin ID
|
pluginctl manifest get '{{.Id}}' # Get plugin ID
|
||||||
pluginctl manifest get '{{.version}}' # Get plugin version
|
pluginctl manifest get '{{.Version}}' # Get plugin version
|
||||||
pluginctl manifest apply # Generate server/webapp manifest files
|
pluginctl manifest apply # Generate server/webapp manifest files
|
||||||
pluginctl manifest check # Validate manifest`
|
pluginctl manifest check # Validate manifest`
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ Examples:
|
||||||
}
|
}
|
||||||
|
|
||||||
var buf bytes.Buffer
|
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)
|
return fmt.Errorf("failed to execute template: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue