Exemplo n.º 1
0
        public static FsPath WithName(this FsPath path, Func <string, string> transformation)
        {
            var    tail        = path.Basename();
            string transformed = transformation(tail);

            if (FsPath.Comparer.Equals(tail, transformed))
            {
                return(path);
            }

            return(path.Parent().Join(transformed));
        }
Exemplo n.º 2
0
 public static FsPath ChangeDirectory(this FsPath path, FsPath directory) =>
 directory.Join(path.Basename());