diff --git a/bridge/src/main/scala/protocbridge/frontend/PosixPluginFrontend.scala b/bridge/src/main/scala/protocbridge/frontend/PosixPluginFrontend.scala index b5f69ff..85d0395 100644 --- a/bridge/src/main/scala/protocbridge/frontend/PosixPluginFrontend.scala +++ b/bridge/src/main/scala/protocbridge/frontend/PosixPluginFrontend.scala @@ -48,10 +48,12 @@ object PosixPluginFrontend extends PluginFrontend { } override def cleanup(state: InternalState): Unit = { - Files.delete(state.inputPipe) - Files.delete(state.outputPipe) - Files.delete(state.tempDir) - Files.delete(state.shellScript) + if (sys.props.get("protocbridge.debug") != Some("1")) { + Files.delete(state.inputPipe) + Files.delete(state.outputPipe) + Files.delete(state.tempDir) + Files.delete(state.shellScript) + } } private def createPipe(tempDirPath: Path, name: String): Path = { diff --git a/bridge/src/main/scala/protocbridge/frontend/WindowsPluginFrontend.scala b/bridge/src/main/scala/protocbridge/frontend/WindowsPluginFrontend.scala index e53edab..73a18c7 100644 --- a/bridge/src/main/scala/protocbridge/frontend/WindowsPluginFrontend.scala +++ b/bridge/src/main/scala/protocbridge/frontend/WindowsPluginFrontend.scala @@ -41,7 +41,9 @@ object WindowsPluginFrontend extends PluginFrontend { } override def cleanup(state: InternalState): Unit = { - Files.delete(state.batFile) + if (sys.props.get("protocbridge.debug") != Some("1")) { + Files.delete(state.batFile) + } } private def createWindowsScript(port: Int): InternalState = {