Scripted tests delete sym linked files and directories
steps
- Write a scripted test that creates a sym link within the scripted test directory to something outside that directory (make sure it is nothing you care about loosing)
- Run
scripted
problem
The source of the link is deleted, whether that is a file or directory, it is gone.
expectation
Nothing outside of the scripted test directory should be deleted.
notes
Reproduction: https://github.com/steinybot/bug-reports/tree/sbt/scripted-deletes-linked-files
The way I ran into this was that I was using:
Compile / npmDevDependencies += "my-node-package" -> "link:/path/to/my/node/package"
and after the test ran it was nuked.
Fortunately I had committed everything and it was a subdirectory within my local git clone so I didn't loose anything that wasn't pushed.
Thanks for the report @steinybot !
So put another way, the clean up code should not have follow symlink turned on, but it does now?
Swoval already has support for not following symlinks. It is toggled by a boolean flag when initializing the FileTreeView:
https://github.com/sbt/io/blob/aec4504a26648df5295eff5b59770163f1ab809a/io/src/main/scala/sbt/internal/nio/SwovalConverters.scala#L42
I'm not sure how it would be best to configure this from sbt.