File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 83
83
var filename = path . basename ( file ) ;
84
84
var ext = path . extname ( filename ) ;
85
85
86
- //ignore _underscored patterns, dotfiles, and non-variant .json files
87
- if ( filename . charAt ( 0 ) === '_' || filename . charAt ( 0 ) === ' .' || ( ext === '.json' && filename . indexOf ( '~' ) === - 1 ) ) {
86
+ //ignore dotfiles and non-variant .json files
87
+ if ( filename . charAt ( 0 ) === '.' || ( ext === '.json' && filename . indexOf ( '~' ) === - 1 ) ) {
88
88
return ;
89
89
}
90
90
145
145
pseudopattern_hunter = new pph ( ) ;
146
146
147
147
//find current pattern in patternlab object using var file as a key
148
- var currentPattern , i ;
148
+ var currentPattern ,
149
+ i ;
150
+
149
151
for ( i = 0 ; i < patternlab . patterns . length ; i ++ ) {
150
152
if ( patternlab . patterns [ i ] . abspath === file ) {
151
153
currentPattern = patternlab . patterns [ i ] ;
152
154
}
153
155
}
154
156
155
- //return if processing a non-variant .json file
157
+ //return if processing an ignored file
156
158
if ( typeof currentPattern === 'undefined' ) {
157
159
return ;
158
160
}
Original file line number Diff line number Diff line change @@ -165,6 +165,11 @@ var patternlab_engine = function () {
165
165
i ;
166
166
167
167
for ( i = 0 ; i < patternlab . patterns . length ; i ++ ) {
168
+ // skip underscore-prefixed files
169
+ if ( path . basename ( patternlab . patterns [ i ] . abspath ) . charAt ( 0 ) === '_' ) {
170
+ continue ;
171
+ }
172
+
168
173
var pattern = patternlab . patterns [ i ] ;
169
174
170
175
// check if the current sub section is different from the previous one
@@ -193,6 +198,11 @@ var patternlab_engine = function () {
193
198
//loop through all patterns.to build the navigation
194
199
//todo: refactor this someday
195
200
for ( var i = 0 ; i < patternlab . patterns . length ; i ++ ) {
201
+ // skip underscore-prefixed files
202
+ if ( path . basename ( patternlab . patterns [ i ] . abspath ) . charAt ( 0 ) === '_' ) {
203
+ continue ;
204
+ }
205
+
196
206
var pattern = patternlab . patterns [ i ] ;
197
207
var bucketName = pattern . name . replace ( / \\ / g, '-' ) . split ( '-' ) [ 1 ] ;
198
208
You can’t perform that action at this time.
0 commit comments