2015-06-06 02:37:09 -04:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
var checkNpm = require('./check-node-modules.js');
|
|
|
|
|
2015-12-21 17:50:56 -05:00
|
|
|
var purgeIfStale = (process.argv.indexOf('--purge') !== -1);
|
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
if (process.env.TRAVIS && !purgeIfStale) {
|
|
|
|
process.exit(0);
|
|
|
|
}
|
|
|
|
|
2015-12-21 17:50:56 -05:00
|
|
|
// check-node-modules will exit(1) if we don't need to install to short-circuit `npm install`
|
|
|
|
// see .travis.yml's `install` block to see the reason for this
|
2016-04-28 20:50:03 -04:00
|
|
|
var nodeModulesOK = checkNpm(true, purgeIfStale);
|
|
|
|
|
|
|
|
process.exit( nodeModulesOK || purgeIfStale ? 0 : 1);
|
2015-06-06 02:37:09 -04:00
|
|
|
|