GitXplorerGitXplorer
c

fswalk

public
7 stars
2 forks
1 issues

Commits

List of commits on branch main.
Unverified
55c0c7e389ed0be2fdd059b1d8cba445a5814928

refactor: drop bespoke unwrap map

ccdaringe committed 9 months ago
Unverified
fa34730e303785f34e064462c6cf58e52dc650ef

refactor!: v3.0.0

ccdaringe committed 9 months ago
Unverified
dfe94abf1f21c4c9279b1a24e25c7ac7cc4947e9

chore: 2.0.3

ccdaringe committed 9 months ago
Verified
bb4001244006bd42ed9bf40b57b43a9f20080edd

Merge pull request #4 from darky/main

ccdaringe committed 9 months ago
Unverified
ec2f6dc090e3aea3c5b6ed34cbb076703cdcf5d1

up gleam for fix opaque warnings

ddarky committed 9 months ago
Unverified
59c6cb0a0dcc6409abe745bc034cef3de41574d0

chore: roll versions fwd

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.