MCPcopy
hub / github.com/wavetermdev/waveterm / ReplaceHomeDir

Function ReplaceHomeDir

pkg/wavebase/wavebase.go:171–180  ·  view source on GitHub ↗
(pathStr string)

Source from the content-addressed store, hash-verified

169}
170
171func ReplaceHomeDir(pathStr string) string {
172 homeDir := GetHomeDir()
173 if pathStr == homeDir {
174 return "~"
175 }
176 if strings.HasPrefix(pathStr, homeDir+"/") {
177 return "~" + pathStr[len(homeDir):]
178 }
179 return pathStr
180}
181
182func GetDomainSocketName() string {
183 return filepath.Join(GetWaveDataDir(), DomainSocketBaseName)

Callers 4

statToFileInfoFunction · 0.92
fileInfoInternalMethod · 0.92

Calls 1

GetHomeDirFunction · 0.70

Tested by

no test coverage detected