2012-03-13 12:10:40 +08:00
|
|
|
|
|
|
|
module.exports = exports = rebuild
|
|
|
|
|
|
|
|
exports.usage = 'Runs "clean", "configure" and "build" all at once'
|
|
|
|
|
2012-06-16 01:00:30 +08:00
|
|
|
var log = require('npmlog')
|
|
|
|
|
2012-03-13 12:10:40 +08:00
|
|
|
function rebuild (gyp, argv, callback) {
|
|
|
|
|
|
|
|
// first "clean"
|
|
|
|
gyp.commands.clean([], function (err) {
|
|
|
|
if (err) {
|
|
|
|
// don't bail
|
2012-06-16 01:00:30 +08:00
|
|
|
log.info('rebuild clean failed', err.stack);
|
2012-03-13 12:10:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gyp.commands.configure([], function (err) {
|
|
|
|
if (err) return callback(err);
|
|
|
|
gyp.commands.build([], callback);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|