-
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
Compilation error when export deps_path
is set
#113
Comments
That is correct, in that case, I can handle the error and default to |
This would work perfectly! Thank you! |
Fixed on latest release v0.7.1, published on hex.pm as well |
For some reason, it is still failing (differently) with 0.7.1:
It does not crash, but still does not generate the
|
Interestingly, I noted that Meaning that we could wrap the defp git(args) do
File.cd!(System.get_env("PWD", File.cwd!()), fn () ->
"git"
|> System.cmd(args)
end)
end But that's not enough. The whole |
Yes, just wrapping everything works for me locally if I just do: File.cd!(System.get_env("PWD", File.cwd!()), fn () ->
install(opts)
end) I don't have all the context for this project, so I prefer to let you patch. |
thanks for the information @warrenseine, I will reopen the issue and update you back once I have more information/fix |
@warrenseine I understand the following, please correct me if I'm wrong:
I think it's best to only support the "regular project architecture" (mono repo project, relative deps folder, etc...) but allow this project to be additionally configured for each different scenario. That will help me to keep the code simple and easier to maintain and contribute Can you please give it a try to #120 and tell me it's enough for your case? Thanks mate! |
Yes, you understood correctly. My use case is simple: I'm using Docker Compose, which seems to be a supported use case! My workspace is on the host, and shared with the guest. To speed up the build, I keep the artifacts/dependencies inside the Docker container, so they don't get synchronized with the workspace (as they would if I used the default relative I totally get your point, and I think your solution is better. I will try the configuration setting! |
If I configure my project like that: if Mix.env() == :dev do
config :git_hooks,
hooks: [
pre_commit: [
tasks: [
{:cmd, "mix format --check-formatted"}
]
]
],
project_path: File.cwd!()
end I can see that the relative path is now correctly pointing to my workspace, rather than the dependency path. However, when I made a reproduction case in this repo if you want to test it. Just checkout and run |
Thanks for the example project, that was super helpful. I updated #120 with a fix, the README has an example of the configuration to make this particular case. I couldn't find any better way to provide the project path to the library, if you do please let me know and I will change it 🙌 |
I tested locally and can confirm it's now working for my use case! Thank you very much! |
awesome! Fixed in the latest release https://github.com/qgadrian/elixir_git_hooks/releases/tag/v0.7.3 |
When
deps_path
is set to a directory outside of the project workspace, build and hook installation fail. I suppose that the library is installed there and thegit rev-parse --git-path ""
command is executed in that directory, which is not a Git repository indeed. See logs:The text was updated successfully, but these errors were encountered: