Skip to content

Commit

Permalink
Groovy REPL: script file detection/execution fails, fixes #1139
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Dec 20, 2024
1 parent 8087827 commit 88e66dd
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ private String expandParameterName(String parameter) {

private void internalExecute() throws Exception {
if (isEngineScript()) {
result = engine.execute(script, expandParameters(args));
result = engine.execute(script.toFile(), expandParameters(args));
} else if (isConsoleScript()) {
executing = true;
boolean done = true;
Expand Down Expand Up @@ -669,9 +669,12 @@ public Object execute(String cmd, String line, String[] args) throws Exception {
if (parser().validCommandName(cmd)) {
file = new ScriptFile(cmd, line, args);
} else {
Path f = Paths.get(line.split("\\s+")[0]);
if (Files.exists(f)) {
file = new ScriptFile(f, line, args);
try {
Path f = Paths.get(line.split("\\s+")[0]);
if (Files.exists(f)) {
file = new ScriptFile(f, line, args);
}
} catch (Exception ignore) {
}
}
if (file != null && file.execute()) {
Expand Down

0 comments on commit 88e66dd

Please sign in to comment.