|
8 | 8 | * |
9 | 9 | */ |
10 | 10 |
|
11 | | -(function () { |
12 | | - "use strict"; |
13 | | - |
14 | | - var fs = require('fs-extra'), |
15 | | - path = require('path'); |
16 | | - |
17 | | - var pattern_exporter = function(){ |
18 | | - |
19 | | - function exportPatterns(patternlab){ |
20 | | - |
21 | | - //read the config export options |
22 | | - var exportKeys = patternlab.config.patternExportKeys; |
23 | | - |
24 | | - //find the chosen patterns to export |
25 | | - for (var i = 0; i < exportKeys.length; i++){ |
26 | | - for (var j = 0; j < patternlab.patterns.length; j++){ |
27 | | - if(exportKeys[i] === patternlab.patterns[j].key){ |
28 | | - //write matches to the desired location |
29 | | - fs.outputFileSync(patternlab.config.patternExportDirectory + patternlab.patterns[j].key + '.html', patternlab.patterns[j].patternPartial); |
30 | | - } |
| 11 | +"use strict"; |
| 12 | + |
| 13 | +var fs = require('fs-extra'); |
| 14 | + |
| 15 | +var pattern_exporter = function () { |
| 16 | + |
| 17 | + function exportPatterns(patternlab) { |
| 18 | + //read the config export options |
| 19 | + var exportKeys = patternlab.config.patternExportKeys; |
| 20 | + |
| 21 | + //find the chosen patterns to export |
| 22 | + for (var i = 0; i < exportKeys.length; i++) { |
| 23 | + for (var j = 0; j < patternlab.patterns.length; j++) { |
| 24 | + if (exportKeys[i] === patternlab.patterns[j].key) { |
| 25 | + //write matches to the desired location |
| 26 | + fs.outputFileSync(patternlab.config.patternExportDirectory + patternlab.patterns[j].key + '.html', patternlab.patterns[j].patternPartial); |
31 | 27 | } |
32 | 28 | } |
33 | 29 | } |
| 30 | + } |
34 | 31 |
|
35 | | - return { |
36 | | - export_patterns: function(patternlab){ |
37 | | - exportPatterns(patternlab); |
38 | | - } |
39 | | - }; |
40 | | - |
| 32 | + return { |
| 33 | + export_patterns: function (patternlab) { |
| 34 | + exportPatterns(patternlab); |
| 35 | + } |
41 | 36 | }; |
42 | 37 |
|
43 | | - module.exports = pattern_exporter; |
| 38 | +}; |
44 | 39 |
|
45 | | -}()); |
| 40 | +module.exports = pattern_exporter; |
0 commit comments