MCPcopy Create free account
hub / github.com/coldbrewcloud/coldbrew-cli / GetApplicationDirectory

Method GetApplicationDirectory

flags/global_flags.go:46–59  ·  view source on GitHub ↗

GetApplicationDirectory returns an absolute path of the application directory.

()

Source from the content-addressed store, hash-verified

44
45// GetApplicationDirectory returns an absolute path of the application directory.
46func (gf *GlobalFlags) GetApplicationDirectory() (string, error) {
47 appDir := conv.S(gf.AppDirectory)
48 if utils.IsBlank(appDir) {
49 appDir = "." // default: current working directory
50 }
51
52 // resolve to absolute path
53 absPath, err := filepath.Abs(appDir)
54 if err != nil {
55 return "", fmt.Errorf("Error retrieving absolute path [%s]: %s", appDir, err.Error())
56 }
57
58 return absPath, nil
59}
60
61// GetConfigFile returns an absolute path of the configuration file.
62func (gf *GlobalFlags) GetConfigFile() (string, error) {

Callers 3

GetConfigFileMethod · 0.95
buildDockerImageMethod · 0.80
RunMethod · 0.80

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected