Skip to content

Instantly share code, notes, and snippets.

@patrixr
Created December 7, 2020 02:59
Show Gist options
  • Save patrixr/cc3528b21ed462bbbd2f1a06588251ae to your computer and use it in GitHub Desktop.
Save patrixr/cc3528b21ed462bbbd2f1a06588251ae to your computer and use it in GitHub Desktop.
const { execSync } = require('child_process');
const files = execSync(`git --no-pager diff --name-only HEAD HEAD~1`).toString().split('\n');
const extensions = {}
const identity = (i) => i
const upper = (s) => s.toUpperCase()
files.forEach(f => {
const split = f.split('.')
const ext = split[split.length - 1];
extensions[ext] = true;
});
console.log(
Object
.keys(extensions)
.filter(identity)
.map(upper)
.join('/')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment