prompts

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commands added in v0.0.19

type Commands struct {
	PreScaffold  []string `json:"preScaffold"`
	PostScaffold []string `json:"postScaffold"`
}

type FileConditions

type FileConditions struct {
	Condition        string       `json:"condition"`
	Files            []string     `json:"files"`
	WorkingDirectory string       `json:"workingDirectory"`
	Parse            ParseOptions `json:"parse"`
}

type ParseOptions added in v0.0.14

type ParseOptions struct {
	Include string `json:"include"`
	Exclude string `json:"exclude"`
}

type Prompt

type Prompt struct {
	VariableName string      `json:"variableName"`
	Type         string      `json:"type"`
	Default      interface{} `json:"default"`
	Message      string      `json:"message"`
	Options      []string    `json:"options"`
	Required     bool        `json:"required"`
}

func (*Prompt) Validate

func (prompt *Prompt) Validate() error

type PromptFile

type PromptFile struct {
	Prompts  []Prompt         `json:"prompts"`
	Files    []FileConditions `json:"files"`
	Commands Commands         `json:"commands"`
}

func (*PromptFile) RunPrompts

func (promptFile *PromptFile) RunPrompts() (*Prompts, error)

type Prompts

type Prompts struct {
	Prompts  []Prompt
	Answers  map[string]interface{}
	Files    []FileConditions
	Commands Commands
}

func New

func New(promptFilePath string) (*Prompts, error)

func (*Prompts) RunPostCommands added in v0.0.19

func (prompts *Prompts) RunPostCommands(directory string) error

func (*Prompts) RunPreCommands added in v0.0.19

func (prompts *Prompts) RunPreCommands(directory string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL