-
Notifications
You must be signed in to change notification settings - Fork 16
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
mono-repo with multiple applications #114
Comments
Hello @jgallinari! Thanks for reporting the issue! I believe this is the same issue as #113 correct? If that is the case, I opened a PR to validate adding a config to set up the project would work #120 In that case, if this library it's available on both of your projects it should work for both of them. |
Hello, if Mix.env() != :prod do
config :git_hooks,
project_path: "./app1",
auto_install: true,
verbose: true,
hooks: [
pre_commit: [
tasks: [
{:cmd, "mix credo"}, And then, by installing, I got repo/app1> mix git_hooks.install
↗ Installing git hooks...
↗ Writing git hook for `pre_commit` to `../.git/hooks/pre-commit`
↗ Backing up git hook file `../.git/hooks/pre-commit` to `../.git/hooks/pre-commit.pre_git_hooks_backup`
↗ Writing git hook for `pre_push` to `../.git/hooks/pre-push`
↗ Backing up git hook file `../.git/hooks/pre-push` to `../.git/hooks/pre-push.pre_git_hooks_backup` and #!/bin/sh
[ "./app1" != "" ] && cd "./app1"
mix git_hooks.run pre_commit "$@"
[ $? -ne 0 ] && exit 1
exit 0 which works. |
If it's an umbrella application, if both applications use this library you can have this library configured at the root config file instead of on each application. If it's not an umbrella application I can try to dig more to support your case |
Sorry for the delay of my response. |
@jgallinari glad to hear. If you have any issues please free to ping me here or open a new ticket |
Hello,
I'm using a mono-repo with multiple applications in their sub-directory, like
So far, I had installed git_hooks v0.6.5 in the app sub-directories for some pre_commit hook defined for ex. in
repo/app1/config/config.exs
likebut it never worked for me: hooks never got fired automatically.
Then I saw #96.
So I removed
repo/app1/.git/hooks/
and I updated to git_hooks v0.7.1Before that, I had only
.samples
inrepo/.git/hooks/
.After the update, a new pre-commit file appeared in
repo/.git/hooks
that showedSo, it seems to me that it shouldn't work if I would do it also in
app2/
, doesn't it?Then I tried anyway to commit a file in
app1/
with some credo issue I introduced, which producedSo maybe I did something wrong, but I can't get it to work in my case.
If, just for testing, I change
pre-commit
to beThen the same test would work
Any thought about that? 🙂
The text was updated successfully, but these errors were encountered: