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

Enhancement: glob targets #450

Open
flowchartsman opened this issue Dec 27, 2022 · 0 comments
Open

Enhancement: glob targets #450

flowchartsman opened this issue Dec 27, 2022 · 0 comments

Comments

@flowchartsman
Copy link

flowchartsman commented Dec 27, 2022

Describe the feature
I think it would be really nifty to be able to use mage in a make-like way with globs. Note: this is perhaps an alternative or enhancement to #340, which would also enable this sort of thing, albeit with a requisite target.

What problem does this feature address?
I am writing a book using asciidoc, and I have targets for generating PDFs for pre-pub and editing. I would like to be able to generate ALL pdfs (target pdfs) or just one at a time mage manuscript/chapter07.pdf. Currently this isn't possible I don't think, however you could provide a way to mark a function (either exported or not) as accepting a certain glob. Maybe something like this:

func Pdfs() error {
  // get all files
  return pdf(allfiles...)
}

func pdf(fileTargets ...string) error {
  for _, ft := range fileTargets {
    //...
  }
}

mg.Globs(pdf, "manuscript/*.pdf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant