UNPKG

409 BJavaScriptView Raw
1var exec = require('./exec')
2var d3h = require('d3-helpers')
3
4// returns true if there are local uncommitted changes
5// see discussion
6// http://stackoverflow.com/questions/3878624/
7function hasChanges () {
8 var cmd = 'git diff --exit-code HEAD'
9 // returns exit code 1 if there are changes
10 // thus we reverse the true / false order
11 return exec(cmd).then(d3h.no, d3h.yes)
12}
13
14module.exports = hasChanges