mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-10-27 06:09:56 -04:00
Add exported ExpandPathWithHome utility
This commit is contained in:
1 parent
89b74cec1e
commit
81b78068a7
1 file changed
+5
@@ -155,3 +155,8 @@ func EntryIsNotEmpty(entryData []string) bool {
|
||||
}
|
||||
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)
|
||||
}
|
||||
Reference in new issue
Block a user