build-test.js 398 B

12345678910111213141516171819
  1. #!/usr/bin/env node
  2. process.env.NODE_ENV = 'test'
  3. var path = require('path')
  4. var test = null
  5. try {
  6. var pkg = require(path.join(process.cwd(), 'package.json'))
  7. if (pkg.name && process.env[pkg.name.toUpperCase().replace(/-/g, '_')]) {
  8. process.exit(0)
  9. }
  10. test = pkg.prebuild.test
  11. } catch (err) {
  12. // do nothing
  13. }
  14. if (test) require(path.join(process.cwd(), test))
  15. else require('./')()