package
Version:
v0.2.7
Opens a new window with list of versions in this module.
Published: Dec 7, 2024
License: ISC
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Append struct {
Filepath string `yaml:"filepath"`
Content string `yaml:"content"`
}
Append is used for adding content to files.
Appends is the type for a slice of Append type.
type Delete struct {
Glob string
}
Delete is used for deteling files or directories.
Deletes is the type for a slice of Delete type.
type Edits struct {
Deletes Deletes `yaml:"deletes"`
Moves Moves `yaml:"moves"`
Appends Appends `yaml:"appends"`
Replaces Replaces `yaml:"replaces"`
}
Edits define all the required edits for a template.
type Move struct {
Src string `yaml:"src"`
Dest string `yaml:"dest"`
}
Move is used for moving (renaming) a file or directory.
Moves is the type for a slice of Move type.
Params define required params for a template.
type Replace struct {
Filepath string `yaml:"filepath"`
Old string `yaml:"old"`
New string `yaml:"new"`
}
Replace is used for replacing content in files.
Replaces is the type for a slice of Replace type.
Service
NewService creates a new template service.
Load reads a template YAML file and makes it available for other methods.
type Template struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Edits Edits `yaml:"edits"`
}
Template has all specifications for a Basil code template.
Execute runs all the edits defined for the template.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.