run.js 443 B

12345678910111213
  1. var readdirSync = require('fs').readdirSync
  2. var spawnSync = require('child_process').spawnSync
  3. var extname = require('path').extname
  4. var files = readdirSync(__dirname)
  5. files.forEach(function(file){
  6. if (extname(file) !== '.js' || file === 'run.js')
  7. return
  8. console.log(`*** ${file} ***`)
  9. var result = spawnSync(process.argv0, [file], { stdio: 'inherit', cwd: __dirname} )
  10. if (result.status !== 0)
  11. process.exit(result.status)
  12. })