mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-28 04:46:42 -04:00
Add exported ExpandPathWithHome utility
This commit is contained in:
@@ -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