mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Testing why config not being returned correctly
This commit is contained in:
1 parent
b6306031dc
commit
77e9b929dc
1 file changed
+6
-6
+6
-6
@@ -115,7 +115,6 @@ masterConfigCommands.add(new libCommand.Command({
|
|||||||
}],
|
}],
|
||||||
handler: async function(args, control) {
|
handler: async function(args, control) {
|
||||||
let response = await libLink.messages.getMasterConfig.send(control);
|
let response = await libLink.messages.getMasterConfig.send(control);
|
||||||
let usefulData = response.serialized_config;
|
|
||||||
let tmpFile = await libFileOps.getTempFile("ctl-", "-tmp", os.tmpdir());
|
let tmpFile = await libFileOps.getTempFile("ctl-", "-tmp", os.tmpdir());
|
||||||
let editor = 0;
|
let editor = 0;
|
||||||
if (args.editor) {
|
if (args.editor) {
|
||||||
@@ -133,7 +132,11 @@ masterConfigCommands.add(new libCommand.Command({
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function afterEditorDone() {
|
async function afterEditorDone() {
|
||||||
print("editordone");
|
print(JSON.stringify(response.serialized_config));
|
||||||
|
let masterConfig = new libConfig.MasterConfig("control");
|
||||||
|
await masterConfig.load(response.serialized_config);
|
||||||
|
await masterConfig.init();
|
||||||
|
print(JSON.stringify(libConfig.MasterConfig.groups));
|
||||||
}
|
}
|
||||||
|
|
||||||
// <-- start process of running editor -->
|
// <-- start process of running editor -->
|
||||||
@@ -148,13 +151,10 @@ masterConfigCommands.add(new libCommand.Command({
|
|||||||
print(err);
|
print(err);
|
||||||
exit(1); // TODO: exit gracefully apon error from editor
|
exit(1); // TODO: exit gracefully apon error from editor
|
||||||
});
|
});
|
||||||
// <-- end process of starting editor -->
|
|
||||||
|
|
||||||
|
|
||||||
editorSpawn.on("exit", (exit) => {
|
editorSpawn.on("exit", (exit) => {
|
||||||
afterEditorDone();
|
afterEditorDone();
|
||||||
// from here is when the edit exits, i.e. the user has quit
|
|
||||||
});
|
});
|
||||||
|
// <-- end process of starting editor -->
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user