Documentation
¶
Overview ¶
Package common ...
Package common ...
Package common ...
Package common ...
Package common ...
Index ¶
- func CheckMaxArgs(items []string, max int) error
- func CheckMinMaxArgs(items []string, min int, max int) error
- func Contains(s []string, str string) bool
- func CopyFileFromEmbeddedFS(efs *embed.FS, fs afero.Fs, pathToFile string, saveTo string) error
- func DirExists(fs afero.Fs, path string) bool
- func FileExists(fs afero.Fs, path string) (bool, error)
- func GetPromptObjectKeys(po []config.PromptObject) []string
- func HelperTextDeploySummary(numOfFolders, numOfFiles int) string
- func HelperTextDryRunFlag() string
- func HelperTextNewProject(projectName string) string
- func HelperTextNewProjectWithExistingTheme(projectName string) string
- func HelperTextNewTheme(projectName string) string
- func MkDir(fs afero.Fs, x ...string) error
- func MoveFile(efs *embed.FS, fs afero.Fs, sourceFile string, saveTo string, backup bool) error
- func PromptConfirm(label string) string
- func PromptGetInput(pc config.PromptContent, validate func(string) error, defaultValue string) (string, error)
- func PromptGetSelect(pc config.PromptContent, items interface{}, withTemplates bool) (string, error)
- func ReadFileLineByLine(appFs afero.Fs, filepath string) ([]string, error)
- func ShowDeployCommandWarningMessages(log *logger.Logger)
- func TouchFile(fs afero.Fs, x ...string) error
- func Union(a, b []string) []string
- func UnionMap(m1, m2 map[string]string) map[string]string
- func Unique(s []string) []string
- func WriteToDisk(fs afero.Fs, inpath string, r io.Reader) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMaxArgs ¶
CheckMaxArgs returns an error if there are more than N args.
func CheckMinMaxArgs ¶
CheckMinMaxArgs returns an error if the number of args is not within the expected range.
func CopyFileFromEmbeddedFS ¶
CopyFileFromEmbeddedFS copy files from the embedded file system to the actual file system.
func FileExists ¶
FileExists returns true if the file exists.
func GetPromptObjectKeys ¶ added in v0.7.0
func GetPromptObjectKeys(po []config.PromptObject) []string
GetPromptObjectKeys returns a slice of string with Ids.
func HelperTextDeploySummary ¶ added in v0.4.0
HelperTextDeploySummary returns a 'summary' text for commands like deploy.
func HelperTextDryRunFlag ¶ added in v0.4.0
func HelperTextDryRunFlag() string
HelperTextDryRunFlag returns a text used when running an action in dry-run mode.
func HelperTextNewProject ¶ added in v0.3.0
HelperTextNewProject returns a 'next step' text used after the project creation.
func HelperTextNewProjectWithExistingTheme ¶ added in v0.8.0
HelperTextNewProjectWithExistingTheme returns a 'next step' text used after the project creation when using an existing theme.
func HelperTextNewTheme ¶ added in v0.8.0
HelperTextNewTheme returns a 'next step' text used after the theme creation.
func MoveFile ¶ added in v0.7.0
MoveFile copy files from the embedded file system to the actual file system and can backups them.
func PromptConfirm ¶ added in v0.5.0
PromptConfirm is used to ask for a yes or no (Y/N) question.
func PromptGetInput ¶
func PromptGetInput(pc config.PromptContent, validate func(string) error, defaultValue string) (string, error)
PromptGetInput is used to prompt an input the user and retrieve the value.
func PromptGetSelect ¶
func PromptGetSelect(pc config.PromptContent, items interface{}, withTemplates bool) (string, error)
PromptGetSelect is used to prompt a list of available options to the user and retrieve the selection.
func ReadFileLineByLine ¶ added in v0.5.2
ReadFileLineByLine returns a slice of strings representing lines of the input file.
func ShowDeployCommandWarningMessages ¶ added in v0.5.0
ShowDeployCommandWarningMessages display a set of useful information for the deploy over FTP process.
func Union ¶ added in v0.5.2
Union returns a slice containing the unique values of the input slices.
Types ¶
This section is empty.