mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-09-04 08:07:18 -04:00
Add exported ExpandPathWithHome utility
This commit is contained in:
@@ -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)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user