👷 allow hygiene to run on a single file

pull/22957/head
Joao Moreno 2017-03-21 11:28:26 +01:00
parent a85a6a22de
commit 9af8da0d50
1 changed files with 8 additions and 0 deletions

View File

@ -238,6 +238,14 @@ if (require.main === module) {
cp.exec('git config core.autocrlf', (err, out) => {
const skipEOL = out.trim() === 'true';
if (process.argv.length > 2) {
return hygiene(process.argv.slice(2), { skipEOL: skipEOL }).on('error', err => {
console.error();
console.error(err);
process.exit(1);
});
}
cp.exec('git diff --cached --name-only', { maxBuffer: 2000 * 1024 }, (err, out) => {
if (err) {
console.error();