run.js 479 B

12345678910111213141516171819202122
  1. #!/usr/bin/env node
  2. let KumaChan = require(`${__dirname}/build/dev/runtime.js`)
  3. let Compiler = (mode, f) => `${__dirname}/build/dev/compiler ${mode} ${f}`
  4. let ChildProcess = require('child_process')
  5. let FS = require('fs')
  6. function run_module (file) {
  7. let transpiled = ChildProcess.execSync (
  8. Compiler('module', file),
  9. { encoding: 'utf8' }
  10. )
  11. eval(transpiled)
  12. }
  13. for (let i = 2; i < process.argv.length; i += 1) {
  14. run_module(process.argv[i])
  15. }