build-package.js 457 B

123456789101112131415
  1. var exec = require('child_process').exec;
  2. function puts(error, stdout, stderr) { console.log(stdout) }
  3. var os = require('os');
  4. //control OS
  5. //then run command depengin on the OS
  6. if (os.type() === 'Linux')
  7. exec("dist/package.sh", puts);
  8. else if (os.type() === 'Darwin')
  9. exec("dist/package.sh", puts);
  10. else if (os.type() === 'Windows_NT')
  11. exec("powershell dist/package.sh", puts);
  12. else
  13. throw new Error("Unsupported OS found: " + os.type());