GitXplorerGitXplorer
c

fswalk

public
7 stars
2 forks
1 issues

Commits

List of commits on branch main.
Unverified
8f5ad7bf7e62bb5dcb77dd04dbc1763520c8d935

Merge branch 'main' of github.com:cdaringe/fswalk

ccdaringe committed a year ago
Unverified
a1b84f895bca8c8affa11bb26694918f1a681541

feat: traverse filtering

ccdaringe committed a year ago
Verified
294b64b7a17a5e7b85bdeca00303e87d4fdb8f17

Merge pull request #2 from cdaringe/renovate/configure

ccdaringe committed a year ago
Unverified
85dc4d624e2d86ce4146ff4a5175f7b759498451

Add renovate.json

rrenovate-bot committed a year ago
Unverified
d56d57573b860fb9a99e2f5097322d5d1bef28af

feat: multi filter

ccdaringe committed a year ago
Unverified
8326fca410053352a2f9c8adc4095365011c66ad

feat: add sugar methods

ccdaringe committed a year ago

README

The README file for this repository.

fswalk

Recursively walk the filesystem starting from the provided path.

Package Version Hex Docs

gleam add fswalk
import fswalk

pub fn main() {
  fswalk.builder()
  |> fswalk.with_path("test/fixture")
  |> fswalk.with_traversal_filter(fn(entry) {
    !string.contains(does: entry.filename, contain: "ignore_folder")
  })
  |> fswalk.walk
  |> iterator.fold([], fn(acc, it) {
    case it {
      Ok(entry) if !entry.stat.is_directory -> [entry.filename, ..acc]
      _ -> acc
    }
  })
  |> should.equal(["test/fixture/b/c/d", "test/fixture/a"])
}

Further documentation can be found at https://hexdocs.pm/fswalk.

Development

gleam run   # Run the project
gleam test  # Run the tests

changelog

  • 1.0.0 - init
  • 2.0.0 - support traverse filtering in tandem with entry filtering
  • 3.0.0
    • dropped .with_entry_filter. Use iterator.* functions on the output instead.
    • dropped sugar functions .map/.each/.fold. Use iterator.* functions on the output instead.