Skip to content

Commit 5380a57

Browse files
committed
Write manifest when saving OBZ
1 parent 4b32670 commit 5380a57

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/processors/obfProcessor.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,19 @@ class ObfProcessor extends BaseProcessor {
741741
data: new TextEncoder().encode(obfContent),
742742
};
743743
});
744+
const manifest: ObfManifest = {
745+
format: OBF_FORMAT_VERSION,
746+
root: tree.metadata.defaultHomePageId,
747+
paths: {
748+
boards: Object.fromEntries(Object.entries(tree.pages).map(([id, page]) => [id, page.id])),
749+
images: {}, //TODO Add support for saving images as files
750+
sounds: {}, //TODO Add support for saving sounds as files
751+
},
752+
};
753+
files.push({
754+
name: 'manifest.json',
755+
data: new TextEncoder().encode(JSON.stringify(manifest)),
756+
});
744757
const fileExists = await pathExists(outputPath);
745758
this.zipFile = await this.options.zipAdapter(
746759
fileExists ? outputPath : undefined,

0 commit comments

Comments
 (0)