From 61a37eaa24b37d4d7a59337b92cb060dbb5d7419 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Sun, 9 Jun 2019 11:47:42 +0200 Subject: [PATCH] Fixed problem with bundles --- src/factory.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/factory.ts b/src/factory.ts index 6a18ba2..0e817d6 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -54,9 +54,9 @@ async function getModelContents(model: FactoryOptions["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"); } @@ -156,7 +156,7 @@ function getModelBufferContents(model: BundleUnit): PartitionedBundle { const bundleKeys = Object.keys(rawBundle); 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