Documentation
¶
Overview ¶
Package cmdutils contains shared functions for commands.
Note that these functions may trigger a process shutdown, DO NOT call these from any other place other than the command line interface.
Index ¶
- func AddRepositoryToConfig(repoURL string) error
- func ExitWithError(message string, exitCode int)
- func ExitWithMessage(message string, exitCode int)
- func ExitWithProblem(message string, exitCode int)
- func ExitWithStackTrace(message string)
- func FilterOutLoadedRepositories(repoURLsToAdd []string, alreadyPresent map[string]string) []string
- func GetGitRepoRootFromWorkingDirectory() string
- func GetHomeDirectory() string
- func GetLoadedConfigFilePaths() []string
- func GetLoadedRepositories() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRepositoryToConfig ¶ added in v0.1.24
func ExitWithError ¶
ExitWithError exits the application gracefully with the provided exit status :exitCode, printing both message and stack trace at the `error` level
func ExitWithMessage ¶ added in v0.1.24
ExitWithMessage exits the application using the provided :exitCode, printing the message :message at the `info` level before that
func ExitWithProblem ¶ added in v0.1.24
ExitWithProblem exits the application with the provided exit status :exitCode, printing the provided message :message before exiting
func ExitWithStackTrace ¶
func ExitWithStackTrace(message string)
ExitWithStackTrace exits the application with exit status 0 while printing both message and stack trace at the 'trace' level
func FilterOutLoadedRepositories ¶ added in v0.1.20
func FilterOutLoadedRepositories( repoURLsToAdd []string, alreadyPresent map[string]string, ) []string
FilterOutLoadedRepositories returns a slice of strings that has repository paths that do not already exist in the configuration :alreadyPresent argument
func GetGitRepoRootFromWorkingDirectory ¶
func GetGitRepoRootFromWorkingDirectory() string
GetGitRepoRootFromWorkingDirectory returns the full path of the child directory containing a ./.git directory from the current working directory
func GetHomeDirectory ¶ added in v0.1.24
func GetHomeDirectory() string
func GetLoadedConfigFilePaths ¶ added in v0.1.20
func GetLoadedConfigFilePaths() []string
GetLoadedConfigFilePaths returns a slice of strings where each string is an absolute path to a loaded configuration file
func GetLoadedRepositories ¶ added in v0.1.20
GetLoadedRepositories retrieves repositories that have already been loaded and returns a `map[string]string` where the key value equals the local path of the repository and the value equals the full absolute path of the configuration file
Types ¶
This section is empty.