Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce IPath<T> interface for easier code reuse #3776

Closed
devlead opened this issue Dec 20, 2021 · 1 comment · Fixed by #3779
Closed

Introduce IPath<T> interface for easier code reuse #3776

devlead opened this issue Dec 20, 2021 · 1 comment · Fixed by #3779
Assignees
Milestone

Comments

@devlead
Copy link
Member

devlead commented Dec 20, 2021

Currently, DirectoryPath and FilePath shares several properties and methods typed so can't be in the base class, an IPath<T> interface with type parameter would make it easier to write shared logic between files and directories

Methods / Properties that can be shared:

  • string FullPath { get; }
  • bool IsRelative { get; }
  • bool IsUNC { get; }
  • char Separator { get; }
  • string[] Segments { get; }
  • string ToString();
  • T MakeAbsolute(ICakeEnvironment environment);
  • T MakeAbsolute(DirectoryPath path);
  • T Collapse();
  • public T GetRelativePath(T to);
@devlead devlead added this to the v2.1.0 milestone Dec 20, 2021
@devlead devlead self-assigned this Dec 20, 2021
devlead added a commit to devlead/cake that referenced this issue Dec 20, 2021
devlead added a commit to devlead/cake that referenced this issue Dec 27, 2021
devlead added a commit that referenced this issue Jan 20, 2022
GH3776,3777,3778: Introduce Directory/File IPath interface, GitHub Actions UploadArtifact relative path support , Add GitHub Actions DownloadArtifact command
@cake-build-bot
Copy link

🎉 This issue has been resolved in version v2.1.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment