Skip to main content
fileset(path, pattern) returns a set of file paths matching pattern within path. The paths are relative to path. The set is unordered; use sort when order matters.

Signature

pattern supports * (any characters except /), ** (any path components), and ? (any single character).

Example

Discover all SQL migration files and run them in alphabetical order:
All .sql files under migrations/ are discovered and applied in alphabetical order, which corresponds to their numeric prefix order (e.g., 001_init.sql, 002_users.sql).

Notes

  • The returned paths are relative to path, not to the playbook directory.
  • Use sort when you need a deterministic traversal order.
  • Hidden files (starting with .) are not included unless the pattern explicitly matches them.
  • Only files are returned, not directories.