diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-09-22 17:16:18 -0400 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-09-22 17:16:18 -0400 |
commit | f82458be8bc8beaab387cc2813b7b18c9b3caac2 (patch) | |
tree | 4d547ad7f2623257cc585e16df17c05c8979e06a /src/client/views/ScriptingRepl.tsx | |
parent | f529d7d22162689c08830418da67a89778111e16 (diff) |
initial commit post master merge
Diffstat (limited to 'src/client/views/ScriptingRepl.tsx')
-rw-r--r-- | src/client/views/ScriptingRepl.tsx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/client/views/ScriptingRepl.tsx b/src/client/views/ScriptingRepl.tsx index e05195ca0..1eb380e0b 100644 --- a/src/client/views/ScriptingRepl.tsx +++ b/src/client/views/ScriptingRepl.tsx @@ -135,19 +135,17 @@ export class ScriptingRepl extends React.Component { this.commands.push({ command: this.commandString, result: script.errors }); return; } - const result = script.run({ args: this.args }); - if (!result.success) { - this.commands.push({ command: this.commandString, result: result.error.toString() }); - return; - } - this.commands.push({ command: this.commandString, result: result.result }); - this.commandsHistory.push(this.commandString); + const result = script.run({ args: this.args }, e => this.commands.push({ command: this.commandString, result: e.toString() })); + if (result.success) { + this.commands.push({ command: this.commandString, result: result.result }); + this.commandsHistory.push(this.commandString); - this.maybeScrollToBottom(); + this.maybeScrollToBottom(); - this.commandString = ""; - this.commandBuffer = ""; - this.historyIndex = -1; + this.commandString = ""; + this.commandBuffer = ""; + this.historyIndex = -1; + } break; } case "ArrowUp": { |