提交 a726cef3 编写于 作者: R Rob Lourens

Check that modules in both the base package.json and remote/ have the same version installed

上级 525f927a
......@@ -79,3 +79,41 @@ if (fs.existsSync(processTreeDts)) {
console.log('Removing windows-process-tree.d.ts');
fs.unlinkSync(processTreeDts);
}
function getInstalledVersion(packageName, cwd) {
const opts = {};
if (cwd) {
opts.cwd = cwd;
}
const result = cp.spawnSync(yarn, ['list', '--pattern', packageName], opts);
const stdout = result.stdout.toString();
const match = stdout.match(new RegExp(packageName + '@(\\S+)'));
if (!match || !match[1]) {
throw new Error('Unexpected output from yarn list: ' + stdout);
}
return match[1];
}
function assertSameVersionsBetweenFolders(packageName, otherFolder) {
const baseVersion = getInstalledVersion(packageName);
const otherVersion = getInstalledVersion(packageName, otherFolder);
if (baseVersion !== otherVersion) {
throw new Error(`Mismatched versions installed for ${packageName}: root has ${baseVersion}, ./${otherFolder} has ${otherVersion}. These should be the same!`);
}
}
// Check that modules in both the base package.json and remote/ have the same version installed
const requireSameVersionsInRemote = [
'xterm',
'xterm-addon-search',
'xterm-addon-web-links',
'node-pty',
'vscode-ripgrep'
];
requireSameVersionsInRemote.forEach(packageName => {
assertSameVersionsBetweenFolders(packageName, 'remote');
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册