new: port the shell, empty, makefile and go templates to manifests
Move the four templates' static file bodies into .tpl files under
data/templates/<id>/, referenced by their manifests' files: lists —
the shell skeleton script (executable, {command}-named) with its
skeleton-only debian/install mapping, the empty template's stub README,
the makefile hello.c/Makefile skeleton with its skeleton-only install
mapping, and go's go.mod/main.go skeleton (the go directive of go.mod
stays a literal: nothing about it is answer-derived).
The empty template ends up hookless — zero Rust, its registry entry
points at no hooks — and src/new/templates/empty.rs is deleted. The
shell and go hooks shrink to their probes (plus go's {go_import_path}
context value); the makefile hooks keep only the existing-tree hint
probing the packaged Makefile for a phony install: target, since that
heuristic reads the tree and cannot be data.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
module {name}
|
||||
|
||||
go 1.21
|
||||
@@ -0,0 +1,8 @@
|
||||
// Placeholder for {name}, generated by `pkh new`.
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello from {command}!")
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
## The `go` template: a Go module built through dh-golang. The logic half
|
||||
## — the go.mod module-line probe and the `{go_import_path}` value below —
|
||||
## lives in src/new/templates/go.rs.
|
||||
## lives in src/new/templates/go.rs; the skeleton bodies are static data
|
||||
## (the `go` directive of go.mod stays a literal: nothing about it is
|
||||
## answer-derived, so it has no {placeholder}).
|
||||
##
|
||||
## Schema: see src/new/templates/mod.rs.
|
||||
|
||||
@@ -15,4 +17,8 @@ architecture: any
|
||||
rules_dh_line: "dh $@ --buildsystem=golang"
|
||||
source_fields:
|
||||
XS-Go-Import-Path: "{go_import_path}"
|
||||
files: []
|
||||
files:
|
||||
- path: go.mod
|
||||
template: go.mod.tpl
|
||||
- path: main.go
|
||||
template: main.go.tpl
|
||||
|
||||
Reference in New Issue
Block a user