Skip to content

Commit

Permalink
Use compile env to run install mix task
Browse files Browse the repository at this point in the history
This ensures that if the :auto_install configuration changes,
the module will recompile, and the hooks will be installed or
skipped accordingly.
  • Loading branch information
qgadrian committed Dec 4, 2024
1 parent dde94b1 commit dfa5e61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/git_hooks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ defmodule GitHooks do

alias Mix.Tasks.GitHooks.Install

if Application.get_env(:git_hooks, :auto_install, true) do
@auto_install Application.compile_env(:git_hooks, :auto_install, true)

if @auto_install do
Install.run(["--quiet"])
end

Expand Down

0 comments on commit dfa5e61

Please sign in to comment.