mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
Reworked some of editor logic to work with async functions
Now async functions can be used after the editor returns, as before they couldnt be used due to .on being non-async.
This commit is contained in:
1 parent
0564eee400
commit
b6306031dc
1 file changed
+4
-3
+4
-3
@@ -132,6 +132,9 @@ masterConfigCommands.add(new libCommand.Command({
|
||||
exit(1); // TODO: exit gracefully apon no editor
|
||||
}
|
||||
|
||||
async function afterEditorDone() {
|
||||
print("editordone");
|
||||
}
|
||||
|
||||
// <-- start process of running editor -->
|
||||
let editorSpawn = child_process.spawn(editor, [tmpFile], {
|
||||
@@ -149,9 +152,7 @@ masterConfigCommands.add(new libCommand.Command({
|
||||
|
||||
|
||||
editorSpawn.on("exit", (exit) => {
|
||||
let masterConfig = new libConfig.MasterConfig("control");
|
||||
// eslint-disable-next-line
|
||||
masterConfig.load(response);
|
||||
afterEditorDone();
|
||||
// from here is when the edit exits, i.e. the user has quit
|
||||
});
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user