-
Notifications
You must be signed in to change notification settings - Fork 221
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
Allows lefthook to work when node_modules is not in root folder for npx #224
Conversation
npx will automatically install the module if not present. yarn does not do this and complains when the package.json is not found.
the reason for this is that my project has a main folder and a /src folder. the package.json and node_modules is found in the src folder and therefore npx lefthook is not found but it is also not automatically installed because it is missing the @Arkweid |
Thank you! |
can this be released? |
@@ -21,7 +21,7 @@ call_lefthook() | |||
elif bundle exec lefthook -h >/dev/null 2>&1 | |||
then | |||
bundle exec lefthook $1 | |||
elif npx lefthook -h >/dev/null 2>&1 | |||
elif npx @arkweid/lefthook -h >/dev/null 2>&1 | |||
then | |||
npx lefthook $1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this line be updated too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be updated and may be not updated. npx
seems to search for binaries both in node_modules
and in system PATH
, so if if
statement above if passes then there will be lefthook
binary in node_modules
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, that wont work. maybe both should be checked. this is for the case when the module is not in the root of the git project. so doing npx lefthook wont run it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, my bad. The line below also needs to be npx @arkweid/lefthook
Doc fixed in evilmartians#218 Template partially fixed in evilmartians#224
…px (#224) npx will automatically install the module if not present. yarn does not do this and complains when the package.json is not found.
Released in 0.7.7 |
* origin/0-7-stable: 0.7.7: Fix arguments passing and various NPM-related fixes Fix incorrect npx command in git hook script template (#236) Update project URLs in NPM package.json (#235) Pass all arguments to downstream hooks (#231) Allows lefthook to work when node_modules is not in root folder for npx (#224) Do not initialize git config on `help` and `version` commands (#209) node: fix postinstall: process.cwd is a function and should be called
* master: Account for GOAMD64 suffix in directory names in NPM and GEM packages [ci skip] Include version into RPM/DEB packages on release [ci skip] 0.8.0: Skip hooks in merge/rebase, hide summary, NPM installer package Split NPM package to two: bundled and installer (#273) Include archived binaries in the releases (#189) docs: s/agrs/args (#265) [ci skip] chore(lint): Fix golangci-lint complains docs(usage): Add commitlint example in full_guide (#201) Fix unreachable conditional in hook template (#242) fix(hook.tmpl): adds cpu arch and os arch to `lefthook`'s filepath (#260) Replace deprecated `File.exists?` with `exist?` for Ruby wrapper (#263) Fix typo in docs/full_guide.md (#256) 0.7.7: Fix arguments passing and various NPM-related fixes Fix incorrect npx command in git hook script template (#236) Update project URLs in NPM package.json (#235) Pass all arguments to downstream hooks (#231) Allows lefthook to work when node_modules is not in root folder for npx (#224) Do not initialize git config on `help` and `version` commands (#209) node: fix postinstall: process.cwd is a function and should be called Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
npx will automatically install the module if not present. yarn does not do this and complains when the package.json is not found.