Skip to content

Commit 21e0a14

Browse files
committed
fix(tools): select first part of demoSourceParts for filePath
1 parent d81d2e1 commit 21e0a14

File tree

1 file changed

+2
-2
lines changed
  • tools/pfe-tools/custom-elements-manifest/lib

1 file changed

+2
-2
lines changed

tools/pfe-tools/custom-elements-manifest/lib/Manifest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ export class Manifest {
318318
decodeURIComponent(demo.source?.href.replace(options.sourceControlURLPrefix, '') ?? '');
319319
// split the demoSource into an array of parts
320320
const demoSourceParts = demoSource.split('/');
321-
// if demoSourceParts contains options.elementsDir, then build the filePath from the rootDir and the demoSource
322-
const filePath = demoSourceParts.includes(options.elementsDir) ?
321+
// if first part of demoSourceParts contains options.elementsDir, then build the filePath from the rootDir and the demoSource
322+
const filePath = (demoSourceParts.shift() === options.elementsDir) ?
323323
path.normalize(path.posix.join(options.rootDir, demoSource))
324324
: path.normalize(path.posix.join(options.rootDir, options.elementsDir, demoSource));
325325
const [last = ''] = filePath.split(path.sep).reverse();

0 commit comments

Comments
 (0)