@@ -39,7 +39,7 @@ function createCommonFiles(templateDirectory, data) {
3939 }
4040 }
4141
42- var isStockIcon = data . icon && data . icon . match ( / ^ ( a l e r t | a r d u i n o | a r r o w - i n | b a t c h | b l u e t o o t h | b r i d g e - d a s h | b r i d g e | c o g | c o m m e n t | d b | d e b u g | e n v e l o p e | f e e d | f i l e - i n | f i l e - o u t | f i l e | f u n c t i o n | h a s h | i n j e c t | j o i n | l e v e l d b | l i g h t | l i n k - o u t | m o n g o d b | m o u s e | n o d e - c h a n g e d | n o d e - e r r o r | p a r s e r - c s v | p a r s e r - h t m l | p a r s e r - j s o n | p a r s e r - x m l | p a r s e r - y a m l | r a n g e | r e d i s | r p i | s e r i a l | s o r t | s p l i t | s u b f l o w | s w a p | s w i t c h | t e m p l a t e | t i m e r | t r i g g e r | t w i t t e r | w a t c h | w h i t e - g l o b e ) \. p n g $ / ) ;
42+ var isStockIcon = data . icon && ( data . icon . match ( / ^ ( a l e r t | a r d u i n o | a r r o w - i n | b a t c h | b l u e t o o t h | b r i d g e - d a s h | b r i d g e | c o g | c o m m e n t | d b | d e b u g | e n v e l o p e | f e e d | f i l e - i n | f i l e - o u t | f i l e | f u n c t i o n | h a s h | i n j e c t | j o i n | l e v e l d b | l i g h t | l i n k - o u t | m o n g o d b | m o u s e | n o d e - c h a n g e d | n o d e - e r r o r | p a r s e r - c s v | p a r s e r - h t m l | p a r s e r - j s o n | p a r s e r - x m l | p a r s e r - y a m l | r a n g e | r e d i s | r p i | s e r i a l | s o r t | s p l i t | s u b f l o w | s w a p | s w i t c h | t e m p l a t e | t i m e r | t r i g g e r | t w i t t e r | w a t c h | w h i t e - g l o b e ) \. p n g $ / ) || data . icon . match ( / ^ ( n o d e - r e d | f o n t - a w e s o m e ) / ) ) ;
4343 if ( ! isStockIcon ) {
4444 try {
4545 fs . mkdirSync ( path . join ( data . dst , data . module , 'icons' ) ) ;
@@ -143,6 +143,8 @@ function extractKeywords(keywordsStr) {
143143}
144144
145145function function2node ( data , options ) {
146+ // console.log("OPT",options);
147+ // console.log("DATA",data);
146148 "use strict" ;
147149 return when . promise ( function ( resolve , reject ) {
148150 // Read meta data in js file
@@ -181,7 +183,7 @@ function function2node(data, options) {
181183 }
182184
183185 if ( data . icon ) {
184- if ( ! data . icon . match ( / \. ( p n g | g i f ) $ / ) ) {
186+ if ( ! data . icon . match ( / \. ( p n g | g i f ) $ / ) && ! data . icon . match ( / ^ ( n o d e - r e d | f o n t - a w e s o m e ) / ) ) {
185187 data . icon = data . icon + '.png' ;
186188 }
187189 if ( ! data . icon . match ( / ^ [ a - z A - Z 0 - 9 \- \. / ] + $ / ) ) {
@@ -213,15 +215,22 @@ function function2node(data, options) {
213215 keywords : extractKeywords ( data . keywords ) ,
214216 category : data . category || 'function' ,
215217 icon : function ( ) {
216- if ( data . icon ) {
217- return path . basename ( data . icon ) ;
218+ if ( data . icon ) {
219+ if ( ! data . icon . match ( / ^ ( n o d e - r e d | f o n t - a w e s o m e ) / ) ) {
220+ return path . basename ( data . icon ) ;
221+ }
222+ else { return data . icon ; }
218223 } else {
219224 return 'icon.png' ;
220225 }
221226 } ,
222227 color : data . color || '#C0DEED' ,
223228 func : jsStringEscape ( data . src ) ,
224- outputs : meta . outputs
229+ outputs : meta . outputs || data . outputs ,
230+ inputLabels : JSON . stringify ( data . inputLabels || [ ] ) ,
231+ outputLabels : JSON . stringify ( data . outputLabels || [ ] ) ,
232+ nodeInfo : jsStringEscape ( data . info || "" ) ,
233+ nodeRead : data . info || ""
225234 } ;
226235
227236 createCommonFiles ( __dirname + '/../templates/function' , data ) ;
0 commit comments