This repository was archived by the owner on Dec 10, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -102,12 +102,14 @@ function pluginInit(patternlab) {
102
102
//we are also being a bit lazy here, since we only expect one file
103
103
let tabJSFileContents = fs . readFileSync ( pluginFiles [ i ] , 'utf8' ) ;
104
104
var snippetString = '' ;
105
- for ( let j = 0 ; j < pluginConfig . tabsToAdd . length ; j ++ ) {
106
- let tabSnippetLocal = tab_frontend_snippet . replace ( / < < t y p e > > / g, pluginConfig . tabsToAdd [ j ] ) . replace ( / < < t y p e U C > > / g, pluginConfig . tabsToAdd [ j ] . toUpperCase ( ) ) ;
107
- snippetString += tabSnippetLocal + EOL ;
105
+ if ( pluginConfig . tabsToAdd && pluginConfig . tabsToAdd . length > 0 ) {
106
+ for ( let j = 0 ; j < pluginConfig . tabsToAdd . length ; j ++ ) {
107
+ let tabSnippetLocal = tab_frontend_snippet . replace ( / < < t y p e > > / g, pluginConfig . tabsToAdd [ j ] ) . replace ( / < < t y p e U C > > / g, pluginConfig . tabsToAdd [ j ] . toUpperCase ( ) ) ;
108
+ snippetString += tabSnippetLocal + EOL ;
109
+ }
110
+ tabJSFileContents = tabJSFileContents . replace ( '/*SNIPPETS*/' , snippetString ) ;
111
+ fs . outputFileSync ( writePath , tabJSFileContents ) ;
108
112
}
109
- tabJSFileContents = tabJSFileContents . replace ( '/*SNIPPETS*/' , snippetString ) ;
110
- fs . outputFileSync ( writePath , tabJSFileContents ) ;
111
113
}
112
114
} catch ( ex ) {
113
115
console . trace ( 'plugin-node-tab: Error occurred while copying pluginFile' , pluginFiles [ i ] ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " plugin-node-tab" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.1 " ,
4
4
"description" : " " ,
5
5
"main" : " index.js" ,
6
6
"dependencies" : {
You can’t perform that action at this time.
0 commit comments