From 4487602f96b10d3ba78917503d31113c75e49366 Mon Sep 17 00:00:00 2001 From: Megan Davidson Date: Thu, 8 Jun 2023 15:22:43 +1200 Subject: [PATCH] fix: only join target and basepath if basepath exists --- src/commands/create-manifest/create-manifest.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/create-manifest/create-manifest.ts b/src/commands/create-manifest/create-manifest.ts index 656e74166..76efdb42b 100644 --- a/src/commands/create-manifest/create-manifest.ts +++ b/src/commands/create-manifest/create-manifest.ts @@ -89,7 +89,13 @@ export async function createManifest( for (const filePath of chunk) { const baseFile = args.flatten ? path.basename(filePath) : filePath.slice(source.length); - const target = fsa.joinAll(targetPath, transformFunc ? transformFunc(baseFile) : baseFile); + let target = targetPath; + // if (targetPath.endsWith('/')) { + // target = fsa.joinAll(targetPath, transformFunc ? transformFunc(baseFile) : baseFile); + // } + if (baseFile) { + target = fsa.joinAll(targetPath, transformFunc ? transformFunc(baseFile) : baseFile); + } validatePaths(filePath, target); current.push({ source: filePath, target }); }