| 33 | }); |
| 34 | }, |
| 35 | document = function(theme) { |
| 36 | console.log('Document with ' + theme); |
| 37 | var command = |
| 38 | "node ../bin/index-cli.js -p ./src/tsconfig.json -n 'TodoMVC Angular 2 documentation' "; |
| 39 | if (theme !== 'gitbook') { |
| 40 | command += ' --theme ' + theme; |
| 41 | } |
| 42 | return new Promise(function(resolve, reject) { |
| 43 | exec( |
| 44 | command, |
| 45 | { |
| 46 | env: { |
| 47 | MODE: 'TESTING' |
| 48 | } |
| 49 | }, |
| 50 | (error, stdout, stderr) => { |
| 51 | if (error) { |
| 52 | console.error(`exec error: ${error}`); |
| 53 | reject(); |
| 54 | } else { |
| 55 | shot('../screenshots/theme-' + theme + '.png').then(function() { |
| 56 | resolve(); |
| 57 | }); |
| 58 | } |
| 59 | } |
| 60 | ); |
| 61 | }); |
| 62 | }; |
| 63 | |
| 64 | var i = 0; |
| 65 | |