3 module.exports = exports = rebuild;
5 exports.usage = 'Runs "clean" and "build" at once';
7 var fs = require('fs');
8 var napi = require('./util/napi.js');
10 function rebuild (gyp, argv, callback) {
11 var package_json = JSON.parse(fs.readFileSync('./package.json'));
13 { name: 'clean', args: [] },
14 { name: 'build', args: ['rebuild'] }
16 commands = napi.expand_commands(package_json, gyp.opts, commands);
17 for (var i = commands.length; i !== 0; i--) {
18 gyp.todo.unshift(commands[i-1]);
20 process.nextTick(callback);