Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse directory of templates without having to define each individually? #1164

Open
tspears1 opened this issue Apr 30, 2024 · 1 comment
Open

Comments

@tspears1
Copy link

tspears1 commented Apr 30, 2024

Is there a simple way to parse an entire directory without having to define and then read each one individually?
For instance, I have a folder of .scss partials using CSS Custom Properties and I want to give the user an option to add a prefix to all pre-defined properties (ie --{{prefix}}-background-color: blue;) before I clone the template directory into their desired output.

I can make it work if I add a template title for each in the md file and then read() the file but that's a bit tedious. Any way to loop through the directory and read each file? I've started to write a helper function recursively using readdir however I can't see a way around having to re-write all of the writefile/mkdir/check exists functionality that you've already elegantly handled.

Any thoughts or guidance? Or maybe this is an enhancement recommendation. Really loving the script!

Your Environment

  • OS: macOS Sonoma
  • scaffdog version: 4.0
@wadackel
Copy link
Collaborator

wadackel commented May 6, 2024

Hi @tspears1, thank you for using scaffdog 🐶

scaffdog currently does not have the capability to analyze entire directories 😭

I apologize for my limited understanding, but could you provide a simple example of the specific file structure you are dealing with and what output you are expecting 👀 ?
A simple example would help me understand and possibly lead to a solution or the development of a refined feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants