Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: typicode/husky
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v9.0.2
Choose a base ref
...
head repository: typicode/husky
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v9.0.3
Choose a head ref
  • 7 commits
  • 7 files changed
  • 4 contributors

Commits on Jan 25, 2024

  1. docs: fix link (#1340)

    typicode authored Jan 25, 2024
    Copy the full SHA
    08908dc View commit details
  2. Copy the full SHA
    e8d4150 View commit details
  3. fix: add scripts field if not present (#1338)

    * fix: add scripts field if not present
    
    * Update bin.js
    
    ---------
    
    Co-authored-by: typicode <typicode@gmail.com>
    chalkygames123 and typicode authored Jan 25, 2024
    Copy the full SHA
    d9941e2 View commit details
  4. docs: changelog link (#1343)

    * docs: changelog link
    
    * Update index.md
    typicode authored Jan 25, 2024
    Copy the full SHA
    31f2100 View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b4eb153 View commit details
  6. fix: fix git hooks path on windows (#1346)

    键来! authored Jan 25, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3148f7e View commit details
  7. 9.0.3

    typicode committed Jan 25, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    417568d View commit details
Showing with 18 additions and 13 deletions.
  1. +2 −2 .github/ISSUE_TEMPLATE/issue.md
  2. +7 −3 .github/README.md
  3. +3 −2 bin.js
  4. +1 −1 docs/index.md
  5. +2 −2 index.js
  6. +2 −2 package-lock.json
  7. +1 −1 package.json
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -9,10 +9,10 @@ assignees: ''

**Troubleshoot**
- [ ] Before creating an issue, please check:
https://typicode.github.io/husky/troubleshooting.html
https://typicode.github.io/husky/troubleshoot.html

If you're migrating from husky 4, see:
https://typicode.github.io/husky/migrating-from-v4.html
https://typicode.github.io/husky/migrate-from-v4.html

**Context**
Please describe your issue and provide some context:
10 changes: 7 additions & 3 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,10 @@
Husky improves your commits and more 🐶 _woof!_

## Changelog

[Check out the v9 changelog](https://github.com/typicode/husky/releases/tag/v9.0.1) to discover all the new and improved features!

## Documentation

https://typicode.github.io/husky
@@ -19,8 +23,8 @@ Support this project by becoming a sponsor [here](https://github.com/sponsors/ty
### GitHub

<p align="center">
<a href="./sponsorkit/sponsors.svg">
<img src='./sponsorkit/sponsors.svg'/>
<a href="../docs/sponsorkit/sponsors.svg">
<img src='../docs/sponsorkit/sponsors.svg'/>
</a>
</p>

@@ -31,4 +35,4 @@ Support this project by becoming a sponsor [here](https://github.com/sponsors/ty
<a href="https://opencollective.com/husky/tiers/company/2/website"><img src="https://opencollective.com/husky/tiers/company/2/avatar.svg?avatarHeight=120"></a>
<a href="https://opencollective.com/husky/tiers/company/3/website"><img src="https://opencollective.com/husky/tiers/company/3/avatar.svg?avatarHeight=120"></a>
<a href="https://opencollective.com/husky/tiers/company/4/website"><img src="https://opencollective.com/husky/tiers/company/4/avatar.svg?avatarHeight=120"></a>
<a href="https://opencollective.com/husky/tiers/company/5/website"><img src="https://opencollective.com/husky/tiers/company/5/avatar.svg?avatarHeight=120"></a>
<a href="https://opencollective.com/husky/tiers/company/5/website"><img src="https://opencollective.com/husky/tiers/company/5/avatar.svg?avatarHeight=120"></a>
5 changes: 3 additions & 2 deletions bin.js
Original file line number Diff line number Diff line change
@@ -7,10 +7,11 @@ let a = process.argv[2]
if (a == 'init') {
let p = process.env.npm_package_json
let d = JSON.parse(f.readFileSync(p))
d.scripts ||= {}
d.scripts.prepare = 'husky'
w('package.json', JSON.stringify(d, null, /\t/.test() ? '\t' : 2))
w('package.json', JSON.stringify(d, null, /\t/.test() ? '\t' : 2) + '\n')
process.stdout.write(i())
w('.husky/pre-commit', process.env.npm_config_user_agent.split('/')[0] + ' test')
w('.husky/pre-commit', process.env.npm_config_user_agent.split('/')[0] + ' test\n')
process.exit()
}

2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ Automatically **lint your commit messages**, **code**, and **run tests** upon co

Get started [here](/get-started).

See what's new in `v9` in the [Changelog]() 🚀
See what's new in `v9` in the [Changelog](https://github.com/typicode/husky/releases/tag/v9.0.1) 🚀

## Sponsors

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ export default (d = '.husky') => {
if (!f.existsSync('.git')) return `.git can't be found`

let _ = (x = '') => p.join(d, '_', x)
let { status: s, stderr: e } = c.spawnSync('git', ['config', 'core.hooksPath', _()])
let { status: s, stderr: e } = c.spawnSync('git', ['config', 'core.hooksPath', `${d}/_`])
if (s == null) return 'git command not found'
if (s) return '' + e

@@ -20,4 +20,4 @@ export default (d = '.husky') => {
l.forEach(h => w(_(h), `#!/usr/bin/env sh\n. "\${0%/*}/h"`, { mode: 0o755 }))
w(_('husky.sh'), '')
return ''
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "husky",
"version": "9.0.2",
"version": "9.0.3",
"description": "Modern native Git hooks",
"keywords": [
"git",