buildexamples.js 695 B

123456789101112131415161718192021222324
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. var childProcess = require('child_process');
  4. var fs = require('fs');
  5. // Build all of the example folders.
  6. dirs = fs.readdirSync('examples');
  7. var cmd;
  8. for (var i = 0; i < dirs.length; i++) {
  9. if (dirs[i].indexOf('.') !== -1) {
  10. continue;
  11. }
  12. if (dirs[i].indexOf('node_modules') !== -1) {
  13. continue;
  14. }
  15. console.log('Building: ' + dirs[i] + '...');
  16. process.chdir('examples/' + dirs[i]);
  17. childProcess.execSync('npm run update', { stdio: [0, 1, 2] });
  18. childProcess.execSync('npm run build', { stdio: [0, 1, 2] });
  19. process.chdir('../..');
  20. }
  21. console.log('\n********\nDone!');