From 90e522296a57fb7ff7fa9402d541beb4f31e0eb3 Mon Sep 17 00:00:00 2001 From: Peter Vanusanik Date: Fri, 20 Jan 2023 09:55:15 +0100 Subject: [PATCH] #24 in develop --- .../slt/plugin/environment/SltLispEnvironmentProcess.java | 4 +--- .../slt/plugin/environment/SltSBCLEnvironment.java | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/en_circle/slt/plugin/environment/SltLispEnvironmentProcess.java b/src/main/java/com/en_circle/slt/plugin/environment/SltLispEnvironmentProcess.java index 364fa9b..b53c5ac 100644 --- a/src/main/java/com/en_circle/slt/plugin/environment/SltLispEnvironmentProcess.java +++ b/src/main/java/com/en_circle/slt/plugin/environment/SltLispEnvironmentProcess.java @@ -27,10 +27,8 @@ public boolean isActive() { public void start(SltLispEnvironmentConfiguration configuration) throws SltProcessException { if (process != null) return; - if (!(configuration instanceof SltLispEnvironmentProcessConfiguration)) + if (!(configuration instanceof SltLispEnvironmentProcessConfiguration processConfiguration)) throw new SltProcessException("Configuration incorrect"); - SltLispEnvironmentProcessConfiguration processConfiguration = (SltLispEnvironmentProcessConfiguration) - configuration; try { Object environment = prepareProcessEnvironment(processConfiguration); diff --git a/src/main/java/com/en_circle/slt/plugin/environment/SltSBCLEnvironment.java b/src/main/java/com/en_circle/slt/plugin/environment/SltSBCLEnvironment.java index cf3d2ca..9971f0f 100644 --- a/src/main/java/com/en_circle/slt/plugin/environment/SltSBCLEnvironment.java +++ b/src/main/java/com/en_circle/slt/plugin/environment/SltSBCLEnvironment.java @@ -5,6 +5,7 @@ import com.en_circle.slt.templates.SltScriptTemplate; import com.intellij.openapi.util.io.FileUtil; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; import org.watertemplate.Template; import java.io.File; @@ -31,7 +32,11 @@ protected Object prepareProcessEnvironment(SltLispEnvironmentProcessConfiguratio e.serverStartSetup = new File(tempDir, "startServer.cl"); e.serverStartSetup.deleteOnExit(); - String startScriptTemplate = new SBCLInitScriptTemplate(c, e.sltCore.getAbsolutePath()).render(); + String sltCorePath = e.sltCore.getAbsolutePath(); + if (sltCorePath.contains("//")) { + sltCorePath = StringUtils.replace(sltCorePath, "\\", "\\\\"); + } + String startScriptTemplate = new SBCLInitScriptTemplate(c, sltCorePath).render(); FileUtils.write(e.serverStartSetup, startScriptTemplate, StandardCharsets.UTF_8); tempDir.deleteOnExit();