git-assert-clean

1.0.0 • Public • Published

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');
  }
});

Readme

Keywords

Package Sidebar

Install

npm i git-assert-clean

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • bendrucker