aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/ScriptingRepl.tsx
diff options
context:
space:
mode:
authorkimdahey <claire_kim1@brown.edu>2019-09-21 15:43:22 -0400
committerkimdahey <claire_kim1@brown.edu>2019-09-21 15:43:22 -0400
commit0b0789816e8a996b32d92e305da84b5922a49f40 (patch)
treee0a5ae13305c3f4d20413c5930f8281741fade98 /src/client/views/ScriptingRepl.tsx
parentf520d5a821b515e0c216f055e93f0549bd6733a9 (diff)
parent1d5dc3eb4095cea017412de9519b8eaee979c16c (diff)
merge conflicts
Diffstat (limited to 'src/client/views/ScriptingRepl.tsx')
-rw-r--r--src/client/views/ScriptingRepl.tsx20
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": {