Skip to content
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

Add .lefthookrc loading #185

Closed
wants to merge 1 commit into from
Closed

Add .lefthookrc loading #185

wants to merge 1 commit into from

Conversation

skryukov
Copy link
Member

Fixes #178
Probably fixes also #99

The same workaround used in Husky https://typicode.github.io/husky/#/?id=command-not-found

@Envek
Copy link
Member

Envek commented May 12, 2021

Why we need one more config file? Why we can't just add some key to lefthook-local.yml for example?

@SAGARSURI
Copy link

Any update on this?

@skryukov
Copy link
Member Author

So the problem is - we need to load PATH using shell script only (in the case of npm-based Lefthook installation). Parsing a full-featured yaml file is overkill. We can grep file to find line by key name, but what if it will be multiline value? In that case, .lefthookrc seemed like a good enough solution.

@Envek wdyt?

@Envek
Copy link
Member

Envek commented May 22, 2021

In #178 lefthook itself is being found correctly, parses Lefthook YAML config and fails to execute commands defined there due to the incomplete PATH set by GUI clients. So there is no need to execute anything in the hook file before invoking Lefthook itself.

@skryukov
Copy link
Member Author

@Envek in #178 Lefhook installed as a local dependency via npm, so I think it is found by this line https://github.com/evilmartians/lefthook/blob/master/cmd/templates/hook.tmpl#L20

But npx lefthook, yarn lefthook, and even bundle exec lefthook won't work as far as I understand.

@lm93547
Copy link

lm93547 commented Nov 24, 2021

Any update on this

@JosephNK
Copy link

this update need

@Krunal-K-SimformSolutions

Any update? how much time does it take to merge this PR because I have the same issue?

@mrexox mrexox closed this in #392 Dec 5, 2022
mrexox added a commit that referenced this pull request Dec 5, 2022
@mrexox mrexox deleted the feature/add-lefthookrc branch January 23, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm: not found when using a git client and nvm
6 participants