From ecf9e81eb0b02dde974064f1c981a49a73b193e9 Mon Sep 17 00:00:00 2001 From: dev-ig Date: Wed, 29 Nov 2023 11:57:30 +0100 Subject: [PATCH] Fixed a bug which leads to an empty manifest --- src/init/init.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/init/init.ts b/src/init/init.ts index 1639753..129d6b2 100644 --- a/src/init/init.ts +++ b/src/init/init.ts @@ -47,13 +47,15 @@ async function generateNomoManifestContent({ }, ]); + const permissions = selectedPermissions.length > 0 ? selectedPermissions : []; + return { nomo_manifest_version: "1.1.0", webon_id: webonId, webon_name: webonName, webon_version: "0.1.0", min_nomo_version: "0.3.4", - permissions: selectedPermissions, + permissions: permissions, }; } @@ -85,7 +87,6 @@ function generateNomoCliConfigContent({ }; } - function writeFile(file: GeneratedFile): Promise { return new Promise((resolve, reject) => { fs.writeFile(file.filePath, file.content, (err) => { @@ -93,9 +94,11 @@ function writeFile(file: GeneratedFile): Promise { console.error(`Error writing file ${file.filePath}:`, err); reject(err); } else { - console.log("\x1b[32m", - `${path.basename(file.filePath)} created successfully.`, - "\x1b[0m"); + console.log( + "\x1b[32m", + `${path.basename(file.filePath)} created successfully.`, + "\x1b[0m" + ); resolve(); } });