Skip to content

Commit 263ee42

Browse files
author
Josef Bredereck
committed
Small fix for double nested folders
Only replace the last occurence of the nested pattern folder. like grid-system-grid to grid-system as main folder.
1 parent b30ed5c commit 263ee42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/lib/object_factory.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ const Pattern = function(relPath, data, patternlab) {
8686

8787
// the joined pattern group and subgroup directory
8888
this.flatPatternPath = info.hasDir
89-
? this.subdir.replace(/[\/\\]/g, '-').replace('-' + info.dir, '')
89+
? this.subdir
90+
.replace(/[/\\]/g, '-')
91+
.replace(new RegExp('-' + info.dir + '$'), '')
9092
: this.subdir.replace(/[\/\\]/g, '-'); // '00-atoms-00-global'
9193

9294
// calculated path from the root of the public directory to the generated

0 commit comments

Comments
 (0)