From 4e72be510c8ffc86f384426c8914e9c07970c920 Mon Sep 17 00:00:00 2001 From: Alexander Alemayhu Date: Fri, 27 Dec 2024 06:19:37 +0100 Subject: [PATCH] fix: resolve CSV failure Signed-off-by: Alexander Alemayhu --- src/lib/parser/DeckParser.ts | 2 +- src/lib/parser/WorkSpace.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/parser/DeckParser.ts b/src/lib/parser/DeckParser.ts index e1034b34..cf8dfd66 100644 --- a/src/lib/parser/DeckParser.ts +++ b/src/lib/parser/DeckParser.ts @@ -69,7 +69,7 @@ export class DeckParser { this.noLimits = input.noLimits; this.globalTags = null; this.payload = []; - this.workspace = new Workspace(true, 'fs'); + this.workspace = input.workspace ?? new Workspace(true, 'fs'); this.customExporter = new CustomExporter( input.name, this.workspace.location diff --git a/src/lib/parser/WorkSpace.ts b/src/lib/parser/WorkSpace.ts index 84aa98eb..e6071769 100644 --- a/src/lib/parser/WorkSpace.ts +++ b/src/lib/parser/WorkSpace.ts @@ -31,7 +31,8 @@ class Workspace { if (apkg) { resolve(fs.readFileSync(path.join(this.location, apkg))); } else { - reject(null); + console.log('No APKG file found', this.location); + reject(new Error('No APKG file found')); } }); });