rebuild.js 517 B

1234567891011121314151617181920
  1. 'use strict';
  2. module.exports = exports = rebuild;
  3. exports.usage = 'Runs "clean" and "build" at once';
  4. const napi = require('./util/napi.js');
  5. function rebuild(gyp, argv, callback) {
  6. const package_json = gyp.package_json;
  7. let commands = [
  8. { name: 'clean', args: [] },
  9. { name: 'build', args: ['rebuild'] }
  10. ];
  11. commands = napi.expand_commands(package_json, gyp.opts, commands);
  12. for (let i = commands.length; i !== 0; i--) {
  13. gyp.todo.unshift(commands[i - 1]);
  14. }
  15. process.nextTick(callback);
  16. }