Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / node-pre-gyp / lib / rebuild.js
1 "use strict";
2
3 module.exports = exports = rebuild;
4
5 exports.usage = 'Runs "clean" and "build" at once';
6
7 var fs = require('fs');
8 var napi = require('./util/napi.js');
9
10 function rebuild (gyp, argv, callback) {
11   var package_json = JSON.parse(fs.readFileSync('./package.json'));
12   var commands = [
13     { name: 'clean', args: [] },
14     { name: 'build', args: ['rebuild'] }
15     ];
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]);
19   }
20   process.nextTick(callback);
21 }