Skip to content

Commit 8041a9e

Browse files
Merge pull request scala#13171 from philwalk/scripting-temp-directory-delete-on-exit
call deleteOnExit() after creating temporary scripting compile directory
2 parents f7b28bd + eb7aefd commit 8041a9e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/src/dotty/tools/scripting/ScriptingDriver.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import sys.process._
1919
class ScriptingDriver(compilerArgs: Array[String], scriptFile: File, scriptArgs: Array[String]) extends Driver:
2020
def compileAndRun(pack:(Path, Seq[Path], String) => Boolean = null): Unit =
2121
val outDir = Files.createTempDirectory("scala3-scripting")
22+
outDir.toFile.deleteOnExit()
2223
setup(compilerArgs :+ scriptFile.getAbsolutePath, initCtx.fresh) match
2324
case Some((toCompile, rootCtx)) =>
2425
given Context = rootCtx.fresh.setSetting(rootCtx.settings.outputDir,

0 commit comments

Comments
 (0)