reinstall.js 565 B

12345678910111213141516171819
  1. 'use strict';
  2. module.exports = exports = rebuild;
  3. exports.usage = 'Runs "clean" and "install" at once';
  4. const napi = require('./util/napi.js');
  5. function rebuild(gyp, argv, callback) {
  6. const package_json = gyp.package_json;
  7. let installArgs = [];
  8. const napi_build_version = napi.get_best_napi_build_version(package_json, gyp.opts);
  9. if (napi_build_version != null) installArgs = [napi.get_command_arg(napi_build_version)];
  10. gyp.todo.unshift(
  11. { name: 'clean', args: [] },
  12. { name: 'install', args: installArgs }
  13. );
  14. process.nextTick(callback);
  15. }