GitXplorerGitXplorer
c

fswalk

public
7 stars
2 forks
1 issues

Commits

List of commits on branch main.
Unverified
0fa30e1ab06239b5e12c62cd7a8361bc9e914250

fix: migrate off iterator

ccdaringe committed 23 days ago
Unverified
2874a7f5e609ddfd4b92f08263ec70788acb0424

fix: migrate off iterator

ccdaringe committed 23 days ago
Verified
d714149fd37717239a2c20c740d216148ef67f6a

Merge pull request #6 from darky/main

ccdaringe committed 24 days ago
Unverified
f4058341599c7fdd66899598eeff38a33c737048

use gleam yielder instead of removed iterator

ddarky committed 24 days ago
Verified
1e82f0ed32151beace967baad4b004f9f936deaa

Merge pull request #5 from mdarse/main

ccdaringe committed 4 months ago
Unverified
3d60ca39bfde9ca9e87e53c05d74cfc436c91fcb

chore: update simplifile dependency

mmdarse committed 5 months 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.