Skip to content

Commit

Permalink
Fix InitFs protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Aug 29, 2024
1 parent 721b243 commit ab953a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/protocol/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,15 @@ export class CommandInterfaceOverTransportLayer implements CommandInterface {
const fileEntry = next as InitFileEntry;
const dosConfig = next as DosConfig;

if (dosConfig.jsdosConf.version !== undefined) {
if (dosConfig.jsdosConf?.version !== undefined) {
await sendData("file", ".jsdos/dosbox.conf",
encoder.encode(dosConfig.dosboxConf));
await sendData("file", ".jsdos/jsdos.json",
encoder.encode(JSON.stringify(dosConfig.jsdosConf, null, 2)));
} else if (fileEntry.path !== undefined) {
await sendData("file", fileEntry.path, fileEntry.contents);
} else {
console.error("Unknown init part", next);
}
}
}
Expand Down

0 comments on commit ab953a4

Please sign in to comment.