Skip to content

Commit

Permalink
Update prepush script to only look at file names
Browse files Browse the repository at this point in the history
The prepush script will fail because `git diff dist/` returns a really
long output which causes Node to throw `stdout maxBuffer exceeded`.

`git diff --name-only` outputs only the changed filenames which is
much shorter.

Also display the actual stack trace in the event of an unexpected
error.
  • Loading branch information
tvararu committed Jun 1, 2017
1 parent 1974a3b commit a64b218
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/check-staged.js
@@ -1,8 +1,9 @@
const cp = require('child_process')
const chalk = require('chalk')

cp.exec('git diff dist/', (err, stdout) => {
cp.exec('git diff --name-only dist/', (err, stdout) => {
if (err) {
console.log(chalk.red('ERROR:'), err)
return process.exit(1)
}
if (stdout.toString().length) {
Expand Down

0 comments on commit a64b218

Please sign in to comment.