Documentation
¶
Index ¶
- Variables
- func Confirm(title, description string) (bool, error)
- func InputText(title, description, placeholder string) (string, error)
- func ShowFileStatusTable(files []FileStatusDisplay)
- func ShowInstallMenu(status ProjectStatus, currentVersion, latestVersion string) (string, error)
- func ShowUpdateSummary(updated, skipped, backedUp, created []string, errors []error)
- type ConflictResolution
- type FileConflictAction
- type FileStatusDisplay
- type MenuOption
- type ProjectStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(lipgloss.Color("99")). MarginBottom(1) SuccessStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("46")) ErrorStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("196")) WarningStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("214")) SubtleStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("241")) HighlightStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("212")) )
Styles
Functions ¶
func ShowFileStatusTable ¶
func ShowFileStatusTable(files []FileStatusDisplay)
ShowFileStatusTable displays a table of file statuses
func ShowInstallMenu ¶
func ShowInstallMenu(status ProjectStatus, currentVersion, latestVersion string) (string, error)
ShowInstallMenu shows options based on project status
func ShowUpdateSummary ¶
ShowUpdateSummary shows a summary after update
Types ¶
type ConflictResolution ¶
type ConflictResolution string
ConflictResolution represents how to handle a conflict
const ( ResolutionSkip ConflictResolution = "skip" ResolutionOverwrite ConflictResolution = "overwrite" ResolutionBackup ConflictResolution = "backup" ResolutionView ConflictResolution = "view" )
func ShowConflictResolution ¶
func ShowConflictResolution(modifiedCount int) (ConflictResolution, error)
ShowConflictResolution asks the user how to handle conflicts
func ShowPerFileResolution ¶
func ShowPerFileResolution(path string, diff string) (ConflictResolution, error)
ShowPerFileResolution asks the user what to do with each modified file
type FileConflictAction ¶
type FileConflictAction string
FileConflictAction represents how to handle file conflicts
const ( ConflictSkip FileConflictAction = "skip" ConflictOverwrite FileConflictAction = "overwrite" ConflictBackup FileConflictAction = "backup" ConflictDiff FileConflictAction = "diff" )
func ShowConflictMenu ¶
func ShowConflictMenu(modifiedFiles []string) (FileConflictAction, error)
ShowConflictMenu shows options for handling modified files
type FileStatusDisplay ¶
type FileStatusDisplay struct {
Path string
Status project.FileStatus
Action string // What will happen to this file
}
FileStatusDisplay represents how to display file status
type MenuOption ¶
type MenuOption string
MenuOption represents a main menu option
const ( MenuInstallUpdate MenuOption = "install" MenuDoctor MenuOption = "doctor" MenuMigrate MenuOption = "migrate" MenuExit MenuOption = "exit" )
func ShowMainMenu ¶
func ShowMainMenu() (MenuOption, error)
ShowMainMenu displays the main command center menu
type ProjectStatus ¶
type ProjectStatus int
ProjectStatus represents the detected project status
const ( ProjectStatusNew ProjectStatus = iota ProjectStatusExisting ProjectStatusOutdated )
Click to show internal directories.
Click to hide internal directories.