2015-06-06 02:37:09 -04:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
2016-01-02 01:53:11 -05:00
|
|
|
var fs = require('fs');
|
2015-06-06 02:37:09 -04:00
|
|
|
var fse = require('fs-extra');
|
|
|
|
var path = require('path');
|
|
|
|
|
|
|
|
var NPM_SHRINKWRAP_FILE = 'npm-shrinkwrap.json';
|
2015-12-21 17:50:56 -05:00
|
|
|
var NPM_SHRINKWRAP_CACHED_FILE = 'node_modules/.npm-shrinkwrap.cached.json';
|
2015-06-06 02:37:09 -04:00
|
|
|
var PROJECT_ROOT = path.join(__dirname, '../../');
|
|
|
|
|
|
|
|
process.chdir(PROJECT_ROOT);
|
|
|
|
|
2016-01-02 01:53:11 -05:00
|
|
|
if (fs.existsSync(NPM_SHRINKWRAP_FILE)) {
|
2016-01-03 00:47:09 -05:00
|
|
|
console.log('copying shrinkwrap fingerprint to', NPM_SHRINKWRAP_CACHED_FILE);
|
2016-01-02 01:53:11 -05:00
|
|
|
fse.copySync(NPM_SHRINKWRAP_FILE, NPM_SHRINKWRAP_CACHED_FILE);
|
|
|
|
} else {
|
|
|
|
console.warn(`${NPM_SHRINKWRAP_FILE} not found. Copy operation will be skipped.`);
|
|
|
|
}
|