https://github.com/gilbarbara/repo-tools
Useful CLI commands for working with remote repositories.
https://github.com/gilbarbara/repo-tools
Last synced: 10 months ago
JSON representation
Useful CLI commands for working with remote repositories.
- Host: GitHub
- URL: https://github.com/gilbarbara/repo-tools
- Owner: gilbarbara
- Created: 2019-08-13T04:46:43.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-10-22T23:54:52.000Z (about 2 years ago)
- Last Synced: 2025-03-15T03:48:11.819Z (10 months ago)
- Language: TypeScript
- Homepage:
- Size: 455 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# repo-tools
[](https://www.npmjs.com/package/repo-tools) [](https://travis-ci.org/gilbarbara/repo-tools) [](https://sonarcloud.io/summary/new_code?id=gilbarbara_repo-tools) [](https://sonarcloud.io/summary/new_code?id=gilbarbara_repo-tools)
Useful CLI commands for working with remote repositories.
## Setup
```bash
$ npm install --save-dev repo-tools
```
## Usage
```bash
# 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/yarn/pnpm/bun install`
## Integration
These commands work perfectly with [husky](https://github.com/typicode/husky) hooks (git hooks)
#### pre-commit
```shell
./node_modules/.bin/repo-tools check-remote
```
#### post-merge
```shell
./node_modules/.bin/repo-tools install-packages
```
## License
MIT