Skip to content

Commit 6a2a467

Browse files
author
Josef Bredereck
committed
The separated pattern folder name must be the pattern name
Like @engelfrost suggested it should be the same name, so that there is no error with the pattern group and subgroup names.
1 parent 263ee42 commit 6a2a467

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/core/src/lib/object_factory.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ const Pattern = function(relPath, data, patternlab) {
2222
*/
2323
const pathObj = path.parse(path.normalize(relPath));
2424
const info = {};
25-
// colors(.mustache) is subbed in 00-atoms-/00-global/00-colors
25+
// 00-colors(.mustache) is subbed in 00-atoms-/00-global/00-colors
2626
info.hasDir =
27-
pathObj.dir.indexOf(pathObj.name) !== -1 ||
28-
pathObj.dir.indexOf(pathObj.name.split('~')[0]) !== -1;
27+
path.basename(pathObj.dir) === pathObj.name ||
28+
path.basename(pathObj.dir) === pathObj.name.split('~')[0];
29+
2930
info.dir = info.hasDir ? pathObj.dir.split(path.sep).pop() : '';
3031
info.dirLevel = pathObj.dir.split(path.sep).length;
3132

0 commit comments

Comments
 (0)