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

Implement utility that generates a file tree from a path pattern #767

Closed
tegefaulkes opened this issue Jul 11, 2024 · 1 comment · Fixed by #769
Closed

Implement utility that generates a file tree from a path pattern #767

tegefaulkes opened this issue Jul 11, 2024 · 1 comment · Fixed by #769
Assignees
Labels
development Standard development

Comments

@tegefaulkes
Copy link
Contributor

Specification

There are some common problems to solve to the new unix commands being developed in MatrixAI/Polykey-CLI#32. One main one being the ability to get a filetree based on a file path pattern using wildcards or globing.

  1. A utility for walking a file tree based in a wildcard or glob pattern. So it needs to translate dir*/* or **/dir*/*.ext paths into a full file tree of directories and files that match that path.

The filesystem walker needs to support the following.

  1. Can take either a normal path dir/file, wildcard, dir*/* or globed dir*/**/*.ext paths.
  2. It will need to convert these paths into one or more paths by walking the file tree matching the supplied path.
  3. For our uses, it needs to output every parent directory as well. So for a globed **/*.ext it needs to output every parent directory path in that tree as well. We can add a switch to toggle this.
  4. It needs to work with both the node fs and efs interface.

Most of the commands we need to implement support some level of wildcard or globing. So this is essential to supporting that.

Additional context

Related MatrixAI/Polykey-CLI#32

Tasks

  1. Implement a file system walker that will walk a file tree based on a provided path pattern.
  2. It needs to support simple paths, wildcards and globs.
  3. It needs to output them as a generator.
  4. It needs to output paths in the order they are walked.
  5. It needs an option to output parent directories of paths.
  6. It needs to suport the fs interface to allow use with nodes FS or our EFS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development
Development

Successfully merging a pull request may close this issue.

1 participant