1 Star 0 Fork 0

koukou66/appium

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
check-pruned-shrinkwrap.js 957 Bytes
一键复制 编辑 原始数据 按行查看 历史
dpgraham 提交于 2019-09-05 11:16 . Fix check-pruned-shrinkwrap script
const _ = require('lodash');
const { asyncify } = require('asyncbox');
const { fs, logger } = require('appium-support');
const path = require('path');
const log = new logger.getLogger('ShrinkwrapValidator');
async function main () {
const shrinkwrapPath = path.resolve('npm-shrinkwrap.json');
if (!(await fs.exists(shrinkwrapPath))) {
log.info('No shrinkwrap found. Skipping shrinkwrap check');
return;
}
const shrinkwrap = JSON.parse(await fs.readFile(shrinkwrapPath));
const backupShrinkwrap = JSON.parse(await fs.readFile(path.resolve('npm-shrinkwrap-backup.json')));
log.info('Checking that pruned shrinkwrap is a subset of primary shrinkwrap');
if (!_.isMatch(backupShrinkwrap, shrinkwrap)) {
log.errorAndThrow('Pruned shrinkwrap (shrinkwrap with dev dependencies removed) is not a subset of the original npm-shrinkwrap.json');
}
log.info('Shrinkwrap check passed');
}
if (require.main === module) {
asyncify(main);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/koukou66/appium.git
git@gitee.com:koukou66/appium.git
koukou66
appium
appium
master

搜索帮助