public static FsPath ChangeDirectory(this FsPath path, FsPath original, FsPath replacement) { FsPath relative = path.RelativeTo(original); if (relative == FsPath.None) { return(original); } return(replacement.Join(relative)); }
public static FsPath ChangeDirectory(this FsPath path, FsPath directory) => directory.Join(path.Basename());