Skip to content

Feature request: Run once, then exit #118

Description

@icopp

onchange is very close to being usable as a general-purpose file runner across glob matches in a way I haven't seen with other npm tools.

Here's a quick example of the kind of thing I'm looking at, using https://github.com/drwpow/openapi-typescript to use a schema at docs/whatever.yml to generate src/generated/whatever.ts:

  "dev:openapi": "onchange -a 'docs/*.yml' -- openapi-typescript {{file}} --prettier-config . -o src/generated/{{fileBaseNoExt}}.ts",

If there was a flag to only run that once (without actually watching for further changes), I could use the same functionality in build steps without needing to break out any other script stuff.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions