sbt/scripted-sbt
Dream f624998c91
[2.x] fix: Avoid following symlinks during scripted test cleanup (#8985)
**Problem**
When a scripted test creates a symbolic link within the test directory
pointing to a file or directory outside of it, the batch cleanup code
follows the symlink and deletes the external target. This is because
`view.list(base / **, !keep)` recursively traverses symlinked
directories, and the resulting paths resolve to the external location.

**Solution**
Replace the flat recursive glob listing with manual recursion that
checks `FileAttributes.isSymbolicLink` before descending into
directories, matching the pattern already used in `Clean.scala`.
Symlinks are now deleted as leaf nodes without traversing their targets.

Also hoists the cleanup helpers out of the per-test loop since they
only depend on the (constant) temp directory.

Fixes sbt/sbt#7331
2026-03-28 13:10:06 -04:00
..
src/main/scala/sbt/scriptedtest [2.x] fix: Avoid following symlinks during scripted test cleanup (#8985) 2026-03-28 13:10:06 -04:00
NOTICE refactor: Move scripted-sbt-redux back to scripted-sbt 2024-09-15 01:58:23 -04:00