MCPcopy
hub / github.com/git-lfs/git-lfs / ExpandConfigPath

Function ExpandConfigPath

tools/filetools.go:209–220  ·  view source on GitHub ↗

ExpandConfigPath returns a copy of path expanded as with ExpandPath. If the path is empty, the default path is looked up inside $XDG_CONFIG_HOME, or ~/.config if that is not set.

(path, defaultPath string)

Source from the content-addressed store, hash-verified

207// path is empty, the default path is looked up inside $XDG_CONFIG_HOME, or
208// ~/.config if that is not set.
209func ExpandConfigPath(path, defaultPath string) (string, error) {
210 if path != "" {
211 return ExpandPath(path, false)
212 }
213
214 configHome := lookupConfigHome()
215 if configHome != "" {
216 return filepath.Join(configHome, defaultPath), nil
217 }
218
219 return ExpandPath(fmt.Sprintf("~/.config/%s", defaultPath), false)
220}
221
222// VerifyFileHash reads a file and verifies whether the SHA is correct
223// Returns an error if there is a problem

Callers 2

GetRootAttributePathsFunction · 0.92
AssertMethod · 0.85

Calls 1

ExpandPathFunction · 0.85

Tested by 1

AssertMethod · 0.68