build(tools): npm/copy-npm-shrinkwrap should gracefully handle situation when shrinkwrap file is missing
This situation occurs during mas update of all dependencies, so we should not throw errors when this happens.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var fs = require('fs');
|
||||
var fse = require('fs-extra');
|
||||
var path = require('path');
|
||||
|
||||
@ -9,4 +10,8 @@ var PROJECT_ROOT = path.join(__dirname, '../../');
|
||||
|
||||
process.chdir(PROJECT_ROOT);
|
||||
|
||||
if (fs.existsSync(NPM_SHRINKWRAP_FILE)) {
|
||||
fse.copySync(NPM_SHRINKWRAP_FILE, NPM_SHRINKWRAP_CACHED_FILE);
|
||||
} else {
|
||||
console.warn(`${NPM_SHRINKWRAP_FILE} not found. Copy operation will be skipped.`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user