Skip to content

Run once, then stop #123

Closed
Closed
@hatton

Description

I've been unable to find an npm glob cli command that has these killer onchange's features:

  • cross-platform globbing
  • {{fileDir}} allows nested files to be easily output while retaining their folder structure

So I would love a mode (e.g. --once) where I can use onchange without watching. I feel bad for requesting this because it's arguably out of scope, but it would be exceptionally helpful if there was an argument to go with --add that would exit after all the jobs were complete. This would allow us to have parallel "build" and "watch" scripts for processors (like pug) that do not have internal glob support.

"build:pug": "onchange --once -add \"**/*.pug\" -- pug {{file}}  --out ../output/{{fileDir}}",
"watch:pug": "onchange -add \"**/*.pug\" -- pug {{file}} --out ../output/{{fileDir}}",

If this seems easy but out of scope, I would appreciate a pointer on how I should go about it. Thanks!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions