MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / Dir

Function Dir

internal/config/config.go:18–28  ·  view source on GitHub ↗

Dir returns ~/.cloudcent, creating it if needed.

()

Source from the content-addressed store, hash-verified

16
17// Dir returns ~/.cloudcent, creating it if needed.
18func Dir() (string, error) {
19 home, err := os.UserHomeDir()
20 if err != nil {
21 return "", fmt.Errorf("failed to get home directory: %w", err)
22 }
23 dir := filepath.Join(home, ".cloudcent")
24 if err := os.MkdirAll(dir, 0o700); err != nil {
25 return "", fmt.Errorf("failed to create config directory: %w", err)
26 }
27 return dir, nil
28}
29
30// Path returns the full path to config.yaml.
31func Path() (string, error) {

Callers 3

PathFunction · 0.85
MetadataGzPathFunction · 0.85
DBPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected