Rework save logic with regard to start instance

Ensure that notifyExit is called if errors occur during startInstance
and createSave request, and rework startInstance save logic to create
a new savegame if no save is present and allow specifying the save to
load.
This commit is contained in:
Hornwitser committed 2020-04-09 16:17:38 +02:00
1 parent 62e38199bd
commit 56ee1fe955
4 files changed
+64 -22

No files matched your search

+2
View File
@@ -251,6 +251,7 @@ commands.push(new Command({
definition: ['start-instance', "Start instance", (yargs) => {
yargs.options({
'instance': { describe: "Instance to start", nargs: 1, type: 'string', demandOption: true },
'save': { describe: "Save load, defaults to latest", nargs: 1, type: 'string' },
});
}],
handler: async function(args, control) {
@@ -258,6 +259,7 @@ commands.push(new Command({
await link.messages.setInstanceOutputSubscriptions.send(control, { instance_ids: [instanceId] });
let response = await link.messages.startInstance.send(control, {
instance_id: instanceId,
save: args.save || null,
});
},
}));