1.0.0 • Published 9 years ago

git-assert-clean v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

git-assert-clean Build Status

Assert that the git working tree is clean

Installing

$ npm install git-assert-clean

API

assertClean([callback]) -> promise

Asserts that the working directory is clean. If it is clean, promise will be resolved with undefined. If it is not, promise will be rejected. If you pass a callback, it will be called with the error.

Promises:

assertClean()
  .then(function () {
    console.log('clean as a whistle!');
  })
  .catch(function (err) {
    console.err(err);
    console.log('git is dirty');
  });

Callbacks:

assertClean(function (err) {
  if (!err) {
    console.log('clean as a whistle!');
  }
  else {
    console.err(err);
    console.log('git is dirty');
  }
});