(Docs) Local setup does not work
See original GitHub issueI followed the steps described in local setup https://commitlint.js.org/#/guides-local-setup?id=add-hook https://github.com/conventional-changelog/commitlint#add-hook
but when I do a commit, it just failes with
.husky/commit-msg: line 3: $(dirname $0)/_/husky.sh: No such file or directory
Expected Behavior
Hook is executed successfully
Current Behavior
The hook cannot be executed
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
I made it work with a shorter command:
npx husky add .husky/commit-msg "npx --no -- commitlint --edit ${1}"
which could replace the following steps from the docs:
Docs
echo '
#!/bin/sh
. "\$(dirname "\$0")/_/husky.sh"
npx --no -- commitlint --edit ${1}
' > .husky/commit-msg
Make hook executable
chmod a+x .husky/commit-msg
I’ll happily provide a PR to change this in the docs. If there is any reason to create this hook by hand it think it need to be changed to
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no -- commitlint --edit
to work correctly. (this is the file npx husky add ...
creates for me)
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
ReadTheDocs - build is not working in local setup · Issue #7416
I am trying to setup a Local Read the Docs Server in a Virtual Machine. Followed the steps mentioned in the above URL,...
Read more >Work on Google Docs, Sheets, & Slides offline - Computer
Install and turn on Google Docs Offline Chrome extension. ... Tip: If your document is not ready to edit offline, an explanation will...
Read more >Local Setup for Documentation Work
Local Setup for Documentation Work ... In case that doesn't work, the point is to get a command similar to this, replace the...
Read more >Development Installation
Go to http://devthedocs.org to access your local instance of Read the Docs. Check that everything works¶. Visit http://devthedocs.org. Login as admin ...
Read more >Troubleshooting Local Testing setup issues in Live
This is caused due to the ClickOnce Trust Prompt Behavior on Windows. This behavior configures whether any Windows ClickOnce Application installation, such as ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you, apologies for adding here when this issue was my fault. Freaking node wasn’t running so npx couldn’t be found when I ran the command. All fixed, thank you much.
@TheKangaroo thanks for helping out here! ❤️