Add exported ExpandPathWithHome utility

This commit is contained in:
2025-01-16 14:22:07 -05:00
parent 89b74cec1e
commit 81b78068a7
+5
View File
@@ -155,3 +155,8 @@ func EntryIsNotEmpty(entryData []string) bool {
} }
return false return false
} }
// ExpandPathWithHome, given a path (as a string) containing "~", returns the path with "~" expanded to the user's home directory.
func ExpandPathWithHome(path string) string {
return strings.Replace(path, "~", Home, 1)
}