Skip to content

Commit

Permalink
hot fix .py name
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed Sep 19, 2023
1 parent 333ae8d commit 3a6fe4e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/myrobotlab/service/Py4j.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,10 @@ public String publishStdOut(String data) {
* @throws IOException
*/
public void saveScript(String scriptName, String code) throws IOException {
Py4jConfig c = (Py4jConfig)config;
FileIO.toFile(c.scriptRootDir + fs + scriptName, code);
if (scriptName != null && !scriptName.toLowerCase().endsWith(".py")) {
scriptName = scriptName + ".py";
}
FileIO.toFile(config.scriptRootDir + fs + scriptName, code);
info("saved file %s", scriptName);
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/myrobotlab/service/Python.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.myrobotlab.logging.Logging;
import org.myrobotlab.logging.LoggingFactory;
import org.myrobotlab.service.config.PythonConfig;
import org.myrobotlab.service.config.ServiceConfig;
import org.myrobotlab.service.data.Script;
import org.myrobotlab.service.interfaces.ServiceLifeCycleListener;
import org.myrobotlab.service.meta.abstracts.MetaData;
Expand Down Expand Up @@ -748,6 +747,9 @@ public void setLocalScriptDir(String path) {
* @throws IOException
*/
public void saveScript(String scriptName, String code) throws IOException {
if (scriptName != null && !scriptName.toLowerCase().endsWith(".py")) {
scriptName = scriptName + ".py";
}
FileIO.toFile(config.scriptRootDir + fs + scriptName, code);
info("saved file %s", scriptName);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/resource/InMoov2/inmoov2.yml

This file was deleted.

0 comments on commit 3a6fe4e

Please sign in to comment.