Skip to content

docs(README.md): update husky hook file creation #3352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2022

Conversation

jpbnetley
Copy link
Contributor

updated the "commit-msg" hook creation. Fixed ENOENT: no such file or directory, open error on pre-commit

Description

Following the docs mentioned here I noticed 2 things.

  1. The file creation portion doesn't work for me (using macOS Or WSL Ubuntu on Windows)
  2. When I create the file manually - the commit-msg hooks gives the error ENOENT: no such file or directory, open error on pre-commit`

Motivation and Context

  1. updated the file creation to use echo and the output redirection operator.
  2. noticed the error ENOENT: no such file or directory, open error on pre-commitis to do with the sting interpellation. changed the string from"${1}"to${1}` (removed the quotes)

Usage examples

In the root of the project directory, can now just run

echo '
#!/bin/sh
. "\$(dirname "\$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
' > .husky/commit-msg

How Has This Been Tested?

I created a new folder structure on my desktop .husky and ran the command to see if the file gets created with the correct content inside of the file.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@escapedcat
Copy link
Member

@sd-godaddy did the recent updates. So tagging him here.
But lgtm and if you tested it every improvement here helps I guess. Thanks!

@escapedcat escapedcat merged commit 5f64c81 into conventional-changelog:master Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants