Documentation ¶
Index ¶
- func CamelCaseToDashCase(name string) string
- func CheckForNilAndHandleError(err error, message string)
- func ClearLine()
- func CopyDirectory(oldDirPath, newDirPath string, exclustionList []string) error
- func CopyFile(oldFilePath, newFilePath string) error
- func CopyPackagedDirectory(oldDirPath, newDirPath string, exclustionList []string) error
- func CreateConfigFile(configDirectoryName string, name string, env string) error
- func CreateNewDirectory(name string) error
- func DashCaseToCamelCase(name string) string
- func DashCaseToSentenceCase(name string) string
- func DoesFileExist(filePath string) (bool, error)
- func HandleError(message string, err error)
- func HashStringMD5(text string) string
- func IsCurrentDirectoryEmpty() (bool, error)
- func ListenForProgramClose(cb func())
- func NewErrorMessage(message string, err error) error
- func Print(items ...interface{})
- func Printf(pattern string, items ...interface{})
- func PromptRequiredString(label string) (string, error)
- func PromptSecretString(label string) (string, error)
- func PromptSelection(label string, choices []string) (string, error)
- func ReadDirectoryContents(dirPath string) ([]string, error)
- func RunCommand(command string, args []string) (string, error)
- func RunCommandWithOutput(command string, args []string) error
- func RunCommandWithSpinner(command string, args []string, terminalSpinner TerminalSpinner) error
- func SentenceToCamelCase(sentence string) string
- func SentenceToDashCase(name string) string
- func TextColor(text string, textColor ...color.Attribute) string
- func WriteNewFile(pathName string, fileName string, content string) error
- func WriteOutTemplateToFile(templatePath string, filePath string, args interface{}) error
- func ZipDirectory(pathToDir, pathToZip string) error
- func ZipFile(fileToZipPath, zipFilePath, zipFileName string) error
- type DefaultConfigFile
- type ProgramCloseCallback
- type TemporaryDirectory
- type TerminalSpinner
- type TerminalSpinnerLogger
- type TerminalTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CamelCaseToDashCase ¶
CamelCaseToDashCase converts a camelCase name to dash case.
func CheckForNilAndHandleError ¶
CheckForNilAndHandleError will check to see if an error is nil and handle the error if it exists.
func CopyDirectory ¶
CopyDirectory copies a directory and its contents to a new location.
func CopyPackagedDirectory ¶
CopyPackagedDirectory copies a directory packaged in the binary and its contents to a new location.
func CreateConfigFile ¶
func CreateNewDirectory ¶
CreateNewDirectory creates a new directory in the current working directory.
func DashCaseToCamelCase ¶
DashCaseToCamelCase converts a dash-case name to camelCase.
func DashCaseToSentenceCase ¶
DashCaseToSentenceCase converts a dash-case name to SentenceCase
func DoesFileExist ¶
DoesFileExist checks if a file exists
func HandleError ¶
HandleError outputs error messages and exits the program.
func IsCurrentDirectoryEmpty ¶
IsCurrentDirectoryEmpty checks to see if the current working directory is empty.
func ListenForProgramClose ¶
func ListenForProgramClose(cb func())
ListenForProgramClose sets a listener for program exits so we can exit gracefully.
func NewErrorMessage ¶
NewErrorMessage creates a new error with a given message.
func PromptRequiredString ¶
PromptRequiredString prompts the user for required string.
func PromptSecretString ¶
PromptSecretString prompts the user for a string that is a secret.
func PromptSelection ¶
PromptSelection prompts the user to pick from a list of choices.
func ReadDirectoryContents ¶
ReadDirectoryContents reads the contents of a directory and returns a list of the names of the contents.
func RunCommand ¶
RunCommand runs a command and return the output.
func RunCommandWithOutput ¶
RunCommandWithOutput runs a command and streams the output to the terminal.
func RunCommandWithSpinner ¶
func RunCommandWithSpinner(command string, args []string, terminalSpinner TerminalSpinner) error
RunCommandWithSpinner runs a command with a spinner instead of streaming the output.
func SentenceToCamelCase ¶
SentenceToCamelCase turns a sentence into camelCase.
func SentenceToDashCase ¶
SentenceToDashCase takes a sentence and turns it into a lowercase string with dash separators.
func WriteNewFile ¶
WriteNewFile writes out a new file with the provided content.
func WriteOutTemplateToFile ¶
func ZipDirectory ¶
ZipDirectory zips a directory.
Types ¶
type DefaultConfigFile ¶
func ReadConfigFile ¶
func ReadConfigFile(configDirectoryName string, env string) (DefaultConfigFile, error)
type ProgramCloseCallback ¶
type ProgramCloseCallback func()
type TemporaryDirectory ¶
type TemporaryDirectory struct {
Name string
}
TemporaryDirectory is a temporary directory that will be cleaned up.
func (*TemporaryDirectory) Clean ¶
func (tmp *TemporaryDirectory) Clean()
func (*TemporaryDirectory) Create ¶
func (tmp *TemporaryDirectory) Create() error
type TerminalSpinner ¶
type TerminalSpinner struct { SpinnerText string CompletedText string FailureText string Element *spinner.Spinner }
func CreateNewTerminalSpinner ¶
func CreateNewTerminalSpinner(spinnerText, completedText, failureText string) TerminalSpinner
CreateNewTerminalSpinner creates a new terminal spinner.
func (*TerminalSpinner) Create ¶
func (t *TerminalSpinner) Create()
func (*TerminalSpinner) Fail ¶
func (t *TerminalSpinner) Fail()
func (*TerminalSpinner) FailWithMessage ¶
func (t *TerminalSpinner) FailWithMessage(message string, err error) error
func (*TerminalSpinner) SetOutput ¶
func (t *TerminalSpinner) SetOutput(writer io.Writer)
func (*TerminalSpinner) Stop ¶
func (t *TerminalSpinner) Stop()
type TerminalSpinnerLogger ¶
type TerminalSpinnerLogger struct{}
type TerminalTable ¶
TerminalTable represents a a terminal table to output.
func CreateTerminalTable ¶
func CreateTerminalTable() TerminalTable
CreateTerminalTable creates a new terminal table.
func (*TerminalTable) AddRow ¶
func (t *TerminalTable) AddRow(pattern string, args ...interface{})
func (*TerminalTable) Print ¶
func (t *TerminalTable) Print()