Skip to content

watch with resourceDir has infinite loop when resource changesΒ #3907

@bishabosha

Description

@bishabosha

Version(s)
1.9.0

Describe the bug
If you use a resource directory with the --watch flag on run command, then the program does run again when the resource dir changes, unfortunately there seems to be a lack of cleanup because the program keeps running over and over in a loop for a single change

To Reproduce
MyLs.sc contents:

//> using resourceDir the-dir
//> using lib "com.lihaoyi::os-lib:0.11.5"

os
  .list(os.pwd / "the-dir")
  .foreach(println)

now run the command

mkdir the-dir
scala-cli MyLs.sc --watch

in parallel run touch the-dir/a

Then there is a loop that runs the program over and over.

Expected behaviour
run a single time per change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    --watchIssues tied to watching sourcesbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions