MCPcopy Index your code
hub / github.com/coldbrewcloud/coldbrew-cli / GetConfigFile

Method GetConfigFile

flags/global_flags.go:62–81  ·  view source on GitHub ↗

GetConfigFile returns an absolute path of the configuration file.

()

Source from the content-addressed store, hash-verified

60
61// GetConfigFile returns an absolute path of the configuration file.
62func (gf *GlobalFlags) GetConfigFile() (string, error) {
63 configFile := conv.S(gf.ConfigFile)
64
65 // if specified config file is absolute path, just use it
66 if !utils.IsBlank(configFile) && filepath.IsAbs(configFile) {
67 return configFile, nil
68 }
69
70 if utils.IsBlank(configFile) {
71 configFile = "./coldbrew.conf" // default: coldbrew.conf
72 }
73
74 // join with application directory
75 appDir, err := gf.GetApplicationDirectory()
76 if err != nil {
77 return "", err
78 }
79
80 return filepath.Join(appDir, configFile), nil
81}
82
83func (gf *GlobalFlags) GetAWSClient() *aws.Client {
84 return aws.NewClient(conv.S(gf.AWSRegion), conv.S(gf.AWSAccessKey), conv.S(gf.AWSSecretKey))

Callers 4

RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80

Calls 1

Tested by

no test coverage detected