aboutsummaryrefslogtreecommitdiff
path: root/node_modules/node-pre-gyp/lib/rebuild.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/node-pre-gyp/lib/rebuild.js')
-rw-r--r--node_modules/node-pre-gyp/lib/rebuild.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/node_modules/node-pre-gyp/lib/rebuild.js b/node_modules/node-pre-gyp/lib/rebuild.js
new file mode 100644
index 00000000..1e3a885c
--- /dev/null
+++ b/node_modules/node-pre-gyp/lib/rebuild.js
@@ -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, commands);
+ for (var i = commands.length; i !== 0; i--) {
+ gyp.todo.unshift(commands[i-1]);
+ }
+ process.nextTick(callback);
+}