MCPcopy Create free account
hub / github.com/exercism/cli / userHome

Function userHome

config/config.go:79–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77}
78
79func userHome() string {
80 var dir string
81 if runtime.GOOS == "windows" {
82 dir = os.Getenv("USERPROFILE")
83 if dir != "" {
84 return dir
85 }
86 dir = filepath.Join(os.Getenv("HOMEDRIVE"), os.Getenv("HOMEPATH"))
87 if dir != "" {
88 return dir
89 }
90 } else {
91 dir = os.Getenv("HOME")
92 if dir != "" {
93 return dir
94 }
95 }
96 // If all else fails, use the current directory.
97 dir, _ = os.Getwd()
98 return dir
99}
100
101// DefaultWorkspaceDir provides a sensible default for the Exercism workspace.
102// The default is different depending on the platform, in order to best match

Callers 1

NewConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected