Created
December 7, 2020 02:59
-
-
Save patrixr/cc3528b21ed462bbbd2f1a06588251ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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