Documentation
¶
Index ¶
Constants ¶
const DefaultBlueprintFile = "project.blueprint.yaml"
DefaultBlueprintFile is the blueprint file name used when no existing project blueprint file can be detected in the working directory.
Variables ¶
This section is empty.
Functions ¶
func DetectBlueprintFile ¶ added in v0.5.0
DetectBlueprintFile returns the name of the first existing project blueprint file in the given directory, probing the supported formats in priority order. It falls back to DefaultBlueprintFile when none are present.
Types ¶
type Preparer ¶
type Preparer interface {
// RemoveGitHistory removes the .git directory from the project.
RemoveGitHistory(directory string) error
// RemoveMaintainerFiles removes files that are meant for template maintainers
// (e.g., README.md, LICENSE) before template processing.
RemoveMaintainerFiles(directory string) error
// SelectBlueprintFormat removes the unused blueprint file.
// The selected format's .tmpl file will be processed by SubstitutePlaceholders.
SelectBlueprintFormat(directory string, format string) error
// SubstitutePlaceholders finds all .tmpl files, processes them as Go templates,
// writes the output without the .tmpl extension, and removes the original .tmpl files.
SubstitutePlaceholders(directory string, values TemplateValues) error
}
Preparer is an interface that provides methods for preparing a project after it has been cloned from a template repository.
func NewDefaultPreparer ¶
func NewDefaultPreparer() Preparer
NewDefaultPreparer creates a new instance of the default Preparer implementation.
type TemplateValues ¶
type TemplateValues struct {
ProjectName string
NormalisedProjectName string
BlueprintFormat string
}
TemplateValues holds the values to substitute in template files.
func NewTemplateValues ¶
func NewTemplateValues(projectName, blueprintFormat string) TemplateValues
NewTemplateValues creates a TemplateValues struct with computed fields.