simple-pre-commit
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -20,2 +20,2 @@ #!/usr/bin/env node | ||
console.log('Set pre commit hooK: ' + command) | ||
console.log('Set pre commit hook: ' + command) |
{ | ||
"name": "simple-pre-commit", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A simple, zero dependency tool for setting up git pre-commit hook for small projects", | ||
@@ -11,9 +11,12 @@ "author": "Mikhail Gorbunov <toplenboren@gmail.com> (toplenboren.gituhb.io)", | ||
"lint": "eslint *.js", | ||
"test": "jest" | ||
"test": "jest", | ||
"publish": "clean-publish" | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"pre-commit", | ||
"git", | ||
"hook", | ||
"lint" | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/toplenboren/simple-pre-commit/issues" | ||
}, | ||
"homepage": "https://github.com/toplenboren/simple-pre-commit", | ||
@@ -24,2 +27,3 @@ "lint-staged": { | ||
"devDependencies": { | ||
"clean-publish": "^1.1.8", | ||
"eslint": "^7.19.0", | ||
@@ -26,0 +30,0 @@ "jest": "^26.6.3", |
# simple-pre-commit | ||
A tool, that let you set any command from `package.json` as a pre-commit hook | ||
A tool, that let you set any command from `package.json` as a pre-commit hook. | ||
## Why? | ||
- Zero dependency | ||
@@ -16,11 +14,17 @@ - Lightweight | ||
`npm install simple-pre-commit --save-dev` | ||
```sh | ||
npm install simple-pre-commit --save-dev | ||
``` | ||
2. Add the `simple-pre-commit` to your `package.json`. Feed it with any command you would like to run as a pre-commit hook. | ||
`"simple-pre-commit":"npx lint-staged"` | ||
```json | ||
"simple-pre-commit": "npx lint-staged"` | ||
``` | ||
3. Run the CLI script to update the git hook with command from `package.json` | ||
`npx simple-pre-commit` | ||
```sh | ||
npx simple-pre-commit | ||
``` | ||
@@ -27,0 +31,0 @@ Now the command from `package.json` is set up as executable git pre-commit hook. |
@@ -8,3 +8,3 @@ const fs = require('fs') | ||
* @param {string} directory | ||
* @return {string | undefined} .git folder path or undefined if if was not found | ||
* @return {string | undefined} .git folder path or undefined if it was not found | ||
*/ | ||
@@ -11,0 +11,0 @@ function getGitProjectRoot(directory=module.parent.filename) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12269
6
51
4
1