Fixed problem with bundles

This commit is contained in:
Alexander Cerutti
2019-06-09 11:47:42 +02:00
parent 46bd6d3b3c
commit 61a37eaa24

View File

@@ -54,9 +54,9 @@ async function getModelContents(model: FactoryOptions["model"]) {
modelContents = getModelBufferContents(model); modelContents = getModelBufferContents(model);
} }
const modelFiles = Object.keys(modelContents); const modelFiles = Object.keys(modelContents.bundle);
if (!(modelFiles.includes("pass.json") && modelFiles.some(file => file.includes("icon")))) { if (!(modelFiles.includes("pass.json") && modelContents.bundle["pass.json"].length && modelFiles.some(file => Boolean(file.includes("icon") && modelContents.bundle[file].length)))) {
throw new Error("missing icon or pass.json"); throw new Error("missing icon or pass.json");
} }
@@ -156,7 +156,7 @@ function getModelBufferContents(model: BundleUnit): PartitionedBundle {
const bundleKeys = Object.keys(rawBundle); const bundleKeys = Object.keys(rawBundle);
if (!bundleKeys.length) { if (!bundleKeys.length) {
throw new Error("Cannot proceed with pass creation: bundle initialized") throw new Error("Cannot proceed with pass creation: bundle not initialized")
} }
// separing localization folders // separing localization folders