MCPcopy Create free account
hub / github.com/driangle/taskmd / resolveProjectRoot

Function resolveProjectRoot

apps/cli/internal/cli/verify.go:234–249  ·  view source on GitHub ↗

resolveProjectRoot returns the absolute path of the directory containing .taskmd.yaml, or cwd as fallback. Since initConfig() already walks up the directory tree to find the config, we just use the config location.

()

Source from the content-addressed store, hash-verified

232// resolveProjectRoot returns the absolute path of the directory containing .taskmd.yaml, or cwd as fallback.
233// Since initConfig() already walks up the directory tree to find the config, we just use the config location.
234func resolveProjectRoot() string {
235 configFile := viper.ConfigFileUsed()
236 if configFile != "" {
237 abs, err := filepath.Abs(filepath.Dir(configFile))
238 if err == nil {
239 return abs
240 }
241 return filepath.Dir(configFile)
242 }
243
244 cwd, err := os.Getwd()
245 if err != nil {
246 return "."
247 }
248 return cwd
249}

Callers 8

runSetVerificationFunction · 0.85
runVerifyFunction · 0.85
buildFromTemplateFunction · 0.85
runContextFunction · 0.85
runGetFunction · 0.85
runTemplatesListFunction · 0.85

Calls

no outgoing calls