File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/main/scala/org/polystat Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ object Java:
9494 for
9595 code <- readCodeFromStdin.compile.string
9696 stdinTmp <- Files [IO ].createTempDirectory.map(path =>
97- path / " stdin.eo "
97+ path / " stdin.java "
9898 )
9999 _ <- writeOutputTo(stdinTmp)(code)
100100 _ <- runJ2EO(
@@ -108,6 +108,15 @@ object Java:
108108 runJ2EO(j2eoVersion, j2eo, inputDir = path, outputDir = tmp)
109109 case Input .FromDirectory (path) =>
110110 runJ2EO(j2eoVersion, j2eo, inputDir = path, outputDir = tmp)
111+ // J2EO deletes the tmp directory when there are no files to analyze
112+ // This causes the subsequent call to EO.analyze to fail, because there is no temp directory.
113+ // The line below patches this issue by creating the temp directory if it was deleted by J2EO.
114+ _ <- Files [IO ]
115+ .exists(tmp)
116+ .ifM(
117+ ifTrue = IO .unit,
118+ ifFalse = Files [IO ].createDirectory(tmp),
119+ )
111120 _ <- EO .analyze(
112121 cfg.copy(input = Input .FromDirectory (tmp))
113122 )
You can’t perform that action at this time.
0 commit comments