/
since.js
34 lines (30 loc) · 1.1 KB
/
since.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict';
const fs = require('fs');
const path = require('path');
const { spawnSync } = require('child_process');
const glob = require('glob-gitignore');
const packagesDir = path.join(__dirname, 'packages');
const docsDir = path.join(__dirname, 'docs');
const packages = (process.argv.length > 2 ? [process.argv[2]] : glob.sync('*', { cwd: packagesDir }))
.map((name) => path.join(packagesDir, name, 'package.json'))
.filter((packagePath) => fs.existsSync(packagePath))
.map((packagePath) => JSON.parse(fs.readFileSync(packagePath)))
.filter((x) => !x.private && x.name !== 'enzyme-example-mocha');
packages.forEach((pkg) => {
const tag = `${pkg.name === 'docs' ? 'enzyme' : pkg.name}@${pkg.version}`;
const dir = path.join(packagesDir, pkg.name);
const logArgs = [
'--no-pager',
'log',
'--oneline',
`${tag}..HEAD`,
dir,
':!**/.eslintrc',
].concat(pkg.name === 'enzyme' ? docsDir : []);
const log = spawnSync('git', logArgs, { stdio: 'pipe' });
if (log.stdout.length > 0 || log.stderr.length > 0) {
console.log(tag);
spawnSync('git', logArgs, { stdio: 'inherit' });
console.log('\n');
}
});