Skip to content

🚀 Feature: Add a glob function to ReadingFileSystem #308

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Feature Request Checklist

Overview

Over in JoshuaKGoldberg/create-typescript-app#2007, I'm working on an options default value that needs to read in from every .yml file within .github/, including .github/actions/*/*.yml and .github/workflows/*.yml. The current implementation has a lot of manual readDirectory calls to get a list of files.

It would be much cleaner to use a glob, like:

const files = await take(inputFromGlob, { globPaths: ['.github/**/*.yml'] });

...which on the inside would need to call to a new bingo-systems > ReadingFileSystem method like, maybe, glob:

import { createReadingFileSystem } from "bingo-systems";

const files = createReadingFileSystem();

const globbedPaths = await files.glob(".github/**/*.yml");

The result would be a string[] of matched paths, like ['.github/workflows/ci.yml'].

Accepting PRs. 🚀

Additional Info

💝

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: accepting prsPlease, send a pull request to resolve this! 🙏type: featureNew enhancement or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions