Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / node-pre-gyp / lib / rebuild.js
diff --git a/legacy-libs/node-pre-gyp/lib/rebuild.js b/legacy-libs/node-pre-gyp/lib/rebuild.js
new file mode 100644 (file)
index 0000000..615a524
--- /dev/null
@@ -0,0 +1,21 @@
+"use strict";
+
+module.exports = exports = rebuild;
+
+exports.usage = 'Runs "clean" and "build" at once';
+
+var fs = require('fs');
+var napi = require('./util/napi.js');
+
+function rebuild (gyp, argv, callback) {
+  var package_json = JSON.parse(fs.readFileSync('./package.json'));
+  var commands = [
+    { name: 'clean', args: [] },
+    { name: 'build', args: ['rebuild'] }
+    ];
+  commands = napi.expand_commands(package_json, gyp.opts, commands);
+  for (var i = commands.length; i !== 0; i--) {
+    gyp.todo.unshift(commands[i-1]);
+  }
+  process.nextTick(callback);
+}