Documentation ¶
Overview ¶
Package configs sets up the environment. First it sets a number of default envs, then looks in the $HOME/.config/ghorg/conf.yaml to overwrite the defaults. These values will be superseded by any command line flags used
Index ¶
- Variables
- func DefaultConfFile() string
- func EnsureTrailingSlashOnFilePath(s string) string
- func EnsureTrailingSlashOnURL(s string) string
- func GetAbsolutePathToCloneTo() string
- func GetOrSetToken()
- func GetRequiredString(key string) string
- func GetTokenFromFile(path string) string
- func GhorgConfDir() string
- func GhorgIgnoreDetected() bool
- func GhorgIgnoreLocation() string
- func GhorgQuiet() bool
- func GhorgReCloneDetected() bool
- func GhorgReCloneLocation() string
- func HomeDir() string
- func IsFilePath(path string) bool
- func Load()
- func VerifyConfigsSetCorrectly() error
- func VerifyTokenSet() error
- func XConfigHomeSet() bool
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoGitHubToken error message when token is not found ErrNoGitHubToken = errors.New("Could not find a valid github token. GHORG_GITHUB_TOKEN or (--token, -t) flag must be set. Create a personal access token, then set it in your $HOME/.config/ghorg/conf.yaml or use the (--token, -t) flag, see 'GitHub Setup' in README.md") // ErrNoGitLabToken error message when token is not found ErrNoGitLabToken = errors.New("Could not find a valid gitlab token. GHORG_GITLAB_TOKEN or (--token, -t) flag must be set. Create a token from gitlab then set it in your $HOME/.config/ghorg/conf.yaml or use the (--token, -t) flag, see 'GitLab Setup' in README.md") // ErrNoGiteaToken error message when token is not found ErrNoGiteaToken = errors.New("Could not find a valid gitea token. GHORG_GITEA_TOKEN or (--token, -t) flag must be set. Create a token from gitea then set it in your $HOME/.config/ghorg/conf.yaml or use the (--token, -t) flag, see 'Gitea Setup' in README.md") // ErrNoBitbucketUsername error message when no username found ErrNoBitbucketUsername = errors.New("Could not find bitbucket username. GHORG_BITBUCKET_USERNAME or (--bitbucket-username) must be set to clone repos from bitbucket, see 'BitBucket Setup' in README.md") // ErrNoBitbucketAppPassword error message when no app password found ErrNoBitbucketAppPassword = errors.New("Could not find a valid bitbucket app password. GHORG_BITBUCKET_APP_PASSWORD or (--token, -t) must be set to clone repos from bitbucket, see 'BitBucket Setup' in README.md") // ErrIncorrectScmType indicates an unsupported scm type being used ErrIncorrectScmType = errors.New("GHORG_SCM_TYPE or --scm must be one of " + strings.Join(scm.SupportedClients(), ", ")) // ErrIncorrectCloneType indicates an unsupported clone type being used ErrIncorrectCloneType = errors.New("GHORG_CLONE_TYPE or --clone-type must be one of org or user") // ErrIncorrectProtocolType indicates an unsupported protocol type being used ErrIncorrectProtocolType = errors.New("GHORG_CLONE_PROTOCOL or --protocol must be one of https or ssh") )
Functions ¶
func DefaultConfFile ¶ added in v1.7.0
func DefaultConfFile() string
func EnsureTrailingSlashOnFilePath ¶ added in v1.7.6
EnsureTrailingSlashOnFilePath takes a filepath and ensures a single / is appened
func EnsureTrailingSlashOnURL ¶ added in v1.7.6
EnsureTrailingSlashOnURL takes a url and ensures a single / is appened
func GetAbsolutePathToCloneTo ¶ added in v1.7.0
func GetAbsolutePathToCloneTo() string
func GetRequiredString ¶
GetRequiredString verifies env is set
func GetTokenFromFile ¶ added in v1.9.10
func GhorgConfDir ¶ added in v1.8.1
func GhorgConfDir() string
GhorgConfDir returns the ghorg directory path
func GhorgIgnoreDetected ¶
func GhorgIgnoreDetected() bool
GhorgIgnoreDetected returns true if a ghorgignore file exists.
func GhorgIgnoreLocation ¶
func GhorgIgnoreLocation() string
GhorgIgnoreLocation returns the path of users ghorgignore
func GhorgQuiet ¶ added in v1.7.12
func GhorgQuiet() bool
func GhorgReCloneDetected ¶ added in v1.8.1
func GhorgReCloneDetected() bool
GhorgReCloneDetected returns true if a reclone.yaml file exists.
func GhorgReCloneLocation ¶ added in v1.8.1
func GhorgReCloneLocation() string
GhorgReCloneLocation returns the path of users ghorgignore
func IsFilePath ¶ added in v1.9.10
func Load ¶
func Load()
Load triggers the configs to load first, not sure if this is actually needed
func VerifyConfigsSetCorrectly ¶
func VerifyConfigsSetCorrectly() error
VerifyConfigsSetCorrectly makes sure flags are set to appropriate values
func VerifyTokenSet ¶
func VerifyTokenSet() error
VerifyTokenSet checks to make sure env is set for the correct scm provider
Types ¶
This section is empty.