| 13 | } |
| 14 | |
| 15 | function buildSchematics(){ |
| 16 | return new Promise((resolve, reject) => { |
| 17 | const cmd = 'tsc'; |
| 18 | const args = [ |
| 19 | '--project', |
| 20 | path.join(__dirname, '..', 'tsconfig.schematics.json'), |
| 21 | ]; |
| 22 | |
| 23 | const p = spawn(cmd, args, { cwd: typescriptPath, stdio: 'inherit', shell: true }); |
| 24 | p.on('close', (code) => { |
| 25 | if (code > 0) { |
| 26 | console.log(`ng-add build exited with ${code}`); |
| 27 | reject(); |
| 28 | } else { |
| 29 | resolve(); |
| 30 | } |
| 31 | }); |
| 32 | }); |
| 33 | } |
| 34 | |
| 35 | function copySchematicsJson(){ |
| 36 | const src = path.join(__dirname, '..', 'src', 'schematics', 'collection.json'); |