scaffolder

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllFiles added in v0.2.3

func GetAllFiles(source string, destination string, scfconfig *scfconfig.ScfConfig, formAnswers map[string]interface{}) (map[string]FileScaffoldInfo, error)

func GetCommandsToRun added in v0.2.3

func GetCommandsToRun(scfConfig *scfconfig.ScfConfig, formAnswers map[string]interface{}) ([]*scfconfig.CommandsToRun, error)

func GetFiles added in v0.2.3

func GetFiles(rootSource string, source string, destination string, sourceGlob []string, parseGlob []string, formAnswers map[string]interface{}) (map[string]FileScaffoldInfo, error)

func ScaffolderCmd added in v0.2.3

func ScaffolderCmd(source string, destination string, scfconfig *scfconfig.ScfConfig, formAnswers map[string]interface{}, force bool) tea.Cmd

func ScaffolderRunCommands added in v0.2.3

func ScaffolderRunCommands(destination string, commands []*scfconfig.CommandsToRun) tea.Cmd

func ScaffolderSetCmd added in v0.2.3

func ScaffolderSetCmd(source string, destination string, scfconfig *scfconfig.ScfConfig, formAnswers map[string]interface{}) tea.Cmd

func ShowProgress added in v0.2.3

func ShowProgress(scaffolderModelState ScaffolderModelState) bool

func ToGlob added in v0.2.3

func ToGlob(source string, glob string) string

Types

type FileScaffoldInfo added in v0.2.3

type FileScaffoldInfo struct {
	Source      string
	Destination string
	Parse       bool
}

func (*FileScaffoldInfo) CopyToDestination added in v0.2.3

func (f *FileScaffoldInfo) CopyToDestination(relMatchPath string, incAmount float64, formAnswers map[string]interface{}) error

func (*FileScaffoldInfo) DoesDestinationExist added in v0.2.3

func (f *FileScaffoldInfo) DoesDestinationExist(relMatchPath string) (bool, error)

type FileStatus added in v0.2.3

type FileStatus struct {
	Files map[string]string
	// contains filtered or unexported fields
}

func NewFileStatus added in v0.2.3

func NewFileStatus() *FileStatus

func (*FileStatus) Get added in v0.2.3

func (f *FileStatus) Get(file string) (string, bool)

func (*FileStatus) Set added in v0.2.3

func (f *FileStatus) Set(file string, status string)

func (*FileStatus) ToString added in v0.2.3

func (f *FileStatus) ToString() string

type ScaffolderAppendCommandsOutputMsg added in v0.2.3

type ScaffolderAppendCommandsOutputMsg struct {
	Output string
}

type ScaffolderIncrementProgressMsg added in v0.2.3

type ScaffolderIncrementProgressMsg struct {
	Increment float64
}

type ScaffolderModel added in v0.2.3

type ScaffolderModel struct {
	CurrentState      ScaffolderModelState
	CompletionMessage string
	Source            string
	Destination       string
	ScfConfig         *scfconfig.ScfConfig
	FormAnswers       map[string]interface{}
	ScrollWindowModel tea.Model
	ProgressModel     progress.Model
	FileStatus        *FileStatus
	CommandsToRun     []*scfconfig.CommandsToRun
	CommandsOutput    string
	ShowScrollWindow  bool
	ProgressWidth     int
	Width             int
	Height            int
}

func NewScaffolderModel added in v0.2.3

func NewScaffolderModel() *ScaffolderModel

func (ScaffolderModel) GetHeaderViewHeight added in v0.2.3

func (m ScaffolderModel) GetHeaderViewHeight() int

func (ScaffolderModel) GetScrollWindowHeight added in v0.2.3

func (m ScaffolderModel) GetScrollWindowHeight() int

func (ScaffolderModel) HeaderView added in v0.2.3

func (m ScaffolderModel) HeaderView() string

func (ScaffolderModel) Init added in v0.2.3

func (m ScaffolderModel) Init() tea.Cmd

func (ScaffolderModel) ProgressView added in v0.2.3

func (m ScaffolderModel) ProgressView() string

func (ScaffolderModel) TitleView added in v0.2.3

func (m ScaffolderModel) TitleView() string

func (ScaffolderModel) Update added in v0.2.3

func (m ScaffolderModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ScaffolderModel) View added in v0.2.3

func (m ScaffolderModel) View() string

type ScaffolderModelState added in v0.2.3

type ScaffolderModelState string
const (
	ScaffolderModelStateScaffolding          ScaffolderModelState = "Scaffolding Files..."
	ScaffolderModelStateFilesExist           ScaffolderModelState = "Files already exist. Overwrite? (y/n)"
	ScaffolderModelStateWaitingToRunCommands ScaffolderModelState = "Scaffolding complete. Press any key to continue."
	ScaffolderModelStateRunningCommands      ScaffolderModelState = "Running Post Scaffolding Commands..."
	ScaffolderModelStateFinished             ScaffolderModelState = "Finished. Press any key to exit."
)

type ScaffolderSetCommandsToRunMsg added in v0.2.3

type ScaffolderSetCommandsToRunMsg struct {
	Commands []*scfconfig.CommandsToRun
}

type ScaffolderSetModelStateMsg added in v0.2.3

type ScaffolderSetModelStateMsg struct {
	State ScaffolderModelState
}

type ScaffolderSetMsg added in v0.2.3

type ScaffolderSetMsg struct {
	Source      string
	Destination string
	ScfConfig   *scfconfig.ScfConfig
	FormAnswers map[string]interface{}
}

type ScaffolderUpdateFileStatusMsg added in v0.2.3

type ScaffolderUpdateFileStatusMsg struct {
	File   string
	Status string
}

Jump to

Keyboard shortcuts

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