forked from enzymejs/enzyme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
since.js
22 lines (18 loc) · 856 Bytes
/
since.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'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 packages = (process.argv.length > 2 ? [process.argv[2]] : glob.sync('*', { cwd: packagesDir }))
.map(name => JSON.parse(fs.readFileSync(path.join(packagesDir, name, 'package.json'))))
.filter(x => !x.private);
packages.forEach((pkg) => {
const tag = `${pkg.name}@${pkg.version}`;
const log = spawnSync('git', ['log', '--oneline', `${tag}..HEAD`, path.join(packagesDir, pkg.name)], { stdio: 'pipe' });
if (log.stdout.length > 0 || log.stderr.length > 0) {
console.log(tag);
spawnSync('git', ['log', '--oneline', `${tag}..HEAD`, path.join(packagesDir, pkg.name)], { stdio: 'inherit' });
console.log('\n');
}
});