repo-tools

Useful commands to work with remote repositories

Usage no npm install needed!

<script type="module">
  import repoTools from 'https://cdn.skypack.dev/repo-tools';
</script>

README

repo-tools

npm version Build Status Maintainability Test Coverage

Useful CLI commands for working with remote repositories.

Setup

$ npm install --save-dev repo-tools

Usage

# with an up-to-date repo
$ ./node_modules/.bin/repo-tools check-remote	
✔ Repo is up-to-date! # exit code 0

# with an outdated repo
$ ./node_modules/.bin/repo-tools check-remote	
⊘ You need to pull, there are new commits. #exit code 1

Commands

check-remote
Compare the local tree with the remote and determine if it needs update.

install-packages
Check if the most recent commit have a modified package.json and run npm install

Integration

These commands work perfectly with husky hooks (git hooks)

{
...
  "husky": {
    "hooks": {
      "pre-commit": "repo-tools check-remote"
      "post-merge": "repo-tools install-packages"
    }
  }
}

License

MIT