scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

watch with resourceDir has infinite loop when resource changes

Open bishabosha opened this issue 3 months ago • 1 comments

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.

bishabosha avatar Oct 09 '25 15:10 bishabosha

relates to https://github.com/VirtusLab/scala-cli/issues/2059

bishabosha avatar Oct 09 '25 15:10 bishabosha