From 0e9cb5ae1e24a8c9cffdb9c3ad49245a52685fd8 Mon Sep 17 00:00:00 2001 From: BeniBenj Date: Wed, 4 Sep 2024 15:24:38 +0200 Subject: [PATCH] More logging --- src/package.ts | 2 +- src/util.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/package.ts b/src/package.ts index a892b6cd..682deff3 100644 --- a/src/package.ts +++ b/src/package.ts @@ -2045,7 +2045,7 @@ export async function printAndValidatePackagedFiles(files: IFile[], cwd: string, getDefaultPackageName(manifest, options), files.map(f => ({ // File path relative to the extension root - origin: !isInMemoryFile(f) ? f.localPath : path.join(cwd, util.vsixPathToFilePath(f.path)), + origin: !isInMemoryFile(f) ? f.localPath : util.vsixPathToFilePath(f.path), // File path in the VSIX tree: f.path })), diff --git a/src/util.ts b/src/util.ts index bccc7374..b18a4777 100644 --- a/src/util.ts +++ b/src/util.ts @@ -284,6 +284,10 @@ export async function generateFileStructureTree(rootFolder: string, filePaths: { const parts = filePath.split('/'); let currentLevel = folderTree; parts.forEach(part => { + if (currentLevel === undefined) { + throw new Error(`currentLevel is undefined for ${part} in ${filePath}`); + } + if (typeof currentLevel[part] === 'number') { currentLevel[part] = size; } else if (currentLevel[part]) {