lifecycle.js 364 B

1234567891011121314
  1. exports = module.exports = runLifecycle
  2. const lifecycleOpts = require('../config/lifecycle')
  3. const lifecycle = require('npm-lifecycle')
  4. function runLifecycle (pkg, stage, wd, moreOpts, cb) {
  5. if (typeof moreOpts === 'function') {
  6. cb = moreOpts
  7. moreOpts = null
  8. }
  9. const opts = lifecycleOpts(moreOpts)
  10. lifecycle(pkg, stage, wd, opts).then(cb, cb)
  11. }