Skip to content

Allow configuring files/folders watched with --watch #2059

Open
@keynmol

Description

@keynmol

Is your feature request related to a problem? Please describe.

When running a script over some input that is neither part of the sources, nor the resources, I would like for --watch mode to be configurable, so it can react to file events from files/folders of my choosing.

Examples:

  • Static site generator which reacts to both markdown changes, and build script changes
  • Any script with file inputs

Describe the solution you'd like

scala-cli run --watch --watching folder/**/*.md

Or a more appropriate name

Describe alternatives you've considered

Manually invoking the command every time I change my markdown files. Like a caveman.

Additional context

Ammonite has it as part of the interp api: https://github.com/com-lihaoyi/Ammonite/blob/main/amm/interp/api/src/main/scala/ammonite/interp/api/InterpAPI.scala#L18 which is strictly more powerful, but I feel like with scala-cli focus on command line args and directives, the simpler solution would be sufficient for many workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    --watchIssues tied to watching sourcesenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions