Skip to content

Commit 88e66dd

Browse files
committed
Groovy REPL: script file detection/execution fails, fixes #1139
1 parent 8087827 commit 88e66dd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

console/src/main/java/org/jline/console/impl/ConsoleEngineImpl.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ private String expandParameterName(String parameter) {
521521

522522
private void internalExecute() throws Exception {
523523
if (isEngineScript()) {
524-
result = engine.execute(script, expandParameters(args));
524+
result = engine.execute(script.toFile(), expandParameters(args));
525525
} else if (isConsoleScript()) {
526526
executing = true;
527527
boolean done = true;
@@ -669,9 +669,12 @@ public Object execute(String cmd, String line, String[] args) throws Exception {
669669
if (parser().validCommandName(cmd)) {
670670
file = new ScriptFile(cmd, line, args);
671671
} else {
672-
Path f = Paths.get(line.split("\\s+")[0]);
673-
if (Files.exists(f)) {
674-
file = new ScriptFile(f, line, args);
672+
try {
673+
Path f = Paths.get(line.split("\\s+")[0]);
674+
if (Files.exists(f)) {
675+
file = new ScriptFile(f, line, args);
676+
}
677+
} catch (Exception ignore) {
675678
}
676679
}
677680
if (file != null && file.execute()) {

0 commit comments

Comments
 (0)