diff --git a/src/dotfiles.rs b/src/dotfiles.rs index 431ef5e..7042ac7 100644 --- a/src/dotfiles.rs +++ b/src/dotfiles.rs @@ -389,10 +389,24 @@ pub fn get_dotfiles_path(profile: Option) -> Result Option { let target_dir = get_dotfiles_target_dir_path().ok()?; - Some(target.strip_prefix(target_dir).ok()?.into()) + Some(target.strip_prefix(target_dir).unwrap_or_else(|_| { + // TODO: Figure out what to do with root component of path, and then + // replace the leading component with a version with an added `^` + target + }).into()) } pub fn get_dotfiles_target_dir_path() -> Result {