MCPcopy
hub / github.com/perkeep/perkeep / NewJSONConfigParser

Function NewJSONConfigParser

internal/osutil/paths.go:344–352  ·  view source on GitHub ↗

NewJSONConfigParser returns a jsonconfig.ConfigParser with its IncludeDirs set with PerkeepConfigDir and the contents of CAMLI_INCLUDE_PATH.

()

Source from the content-addressed store, hash-verified

342// NewJSONConfigParser returns a jsonconfig.ConfigParser with its IncludeDirs
343// set with PerkeepConfigDir and the contents of CAMLI_INCLUDE_PATH.
344func NewJSONConfigParser() *jsonconfig.ConfigParser {
345 var cp jsonconfig.ConfigParser
346 dir, err := PerkeepConfigDir()
347 if err != nil {
348 log.Fatalf("NewJSONConfigParser error: %v", err)
349 }
350 cp.IncludeDirs = append([]string{dir}, filepath.SplitList(os.Getenv("CAMLI_INCLUDE_PATH"))...)
351 return &cp
352}
353
354// PkSourceRoot returns the root of the source tree, or an error.
355func PkSourceRoot() (string, error) {

Callers 3

parseConfigMethod · 0.92
loadFunction · 0.92
findCamliIncludeFunction · 0.85

Calls 2

PerkeepConfigDirFunction · 0.85
FatalfMethod · 0.65

Tested by 1

findCamliIncludeFunction · 0.68