Documentation
¶
Index ¶
- Constants
- Variables
- func Apply(inputDir string, vars map[string]string, outputDir string) error
- func Create(inputDir string, arguments map[string]string, targetDir string) error
- func IsCollection(dir string) (bool, []string)
- func NewQuestion(prompt Prompt) survey.Question
- func ReadFile(path string) (string, error)
- func URLToFs(url string, subPath string, tmpDir string) (string, error)
- type Prompt
- type Prompts
- type SourceFile
- type Template
- type TemplateImpl
Constants ¶
View Source
const (
PromptFile string = "prompts.toml"
)
View Source
const (
ReplacementDelimiter string = "{&{&"
)
Variables ¶
View Source
var ( IgnoredNames = []string{PromptFile} IgnoredDirectories = []string{".git", "node_modules"} )
Functions ¶
func IsCollection ¶
If there are no top level prompts and some subdirectories contain prompts, then we're dealing with a collection. Otherwise it's scaffolding with no prompts
func NewQuestion ¶
func NewQuestion(prompt Prompt) survey.Question
Types ¶
type SourceFile ¶
func (SourceFile) Replace ¶
func (s SourceFile) Replace(vars map[string]string) (SourceFile, error)
type Template ¶
func NewTemplate ¶
type TemplateImpl ¶
type TemplateImpl struct { TPrompts Prompts TQuestions []*survey.Question TArguments map[string]string }
func (TemplateImpl) Arguments ¶
func (t TemplateImpl) Arguments() []Prompt
Source Files
¶
Click to show internal directories.
Click to hide internal directories.