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

[Monorepo][enhancement] Single husky installation for multiple sub projects #758

Closed
blelump opened this issue Sep 9, 2020 · 3 comments
Closed
Labels

Comments

@blelump
Copy link

blelump commented Sep 9, 2020

Hi! First of all, thanks for this tool.

Now to the problem: I am aware of https://github.com/typicode/husky#monorepos and the suggestions stated there, but I'd like to avoid using additional tool to solve this particular problem. I've digged a bit into it and it seems Husky installs husky.sh and husky.local.sh into the .git/hooks dir. So adding:

echo `pwd`
set | egrep GIT

to husky.local.sh prints:

/absolute/path/to/repo/root
GIT_EDITOR='...'
GIT_PREFIX='relative_to_.git_root_path'

Is there any caveat of using "${pwd}/${GIT_PREFIX}" to execute the cd command within husky.local.sh comparing to the current cd "hardcoded/relative/path?

In particular:

# husky.local.sh
packageManager=yarn
SUBPROJECT_DIR="`pwd`/${GIT_PREFIX}"
cd $SUBPROJECT_DIR
@typicode
Copy link
Owner

Hi,

Interesting, thanks for sharing :) Will need to find some time for testing.

@bnbarak
Copy link

bnbarak commented Dec 3, 2020

There is a discussion about the issue here #677. And I have a PR ready to merge here #728.

But, I like your idea of being able to explicitly set the project root.

@stale
Copy link

stale bot commented Jul 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 2, 2021
@stale stale bot closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants