pub fn expand_tilde<P: AsRef<Path>>(path: P) -> Result<PathBuf>
Expands the tilde (~) component to the home directory.
~
Returns an error if the home directory cannot be found.