File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ defmodule Mix.Tasks.GitHooks.Install do
3939
4040 Printer . info ( "Installing git hooks..." )
4141
42+ ensure_hooks_folder_exists ( )
4243 clean_missing_hooks ( )
4344 track_configured_hooks ( )
4445
@@ -111,10 +112,13 @@ defmodule Mix.Tasks.GitHooks.Install do
111112 Printer . warn (
112113 "Couldn't find git_hooks.db file, won't be able to restore old backups: #{ inspect ( error ) } "
113114 )
115+ end
114116
115- Printer . warn (
116- "Check that you are not missing `.git` folder, otherwise open a ticket at https://github.com/qgadrian/elixir_git_hooks/issues/new"
117- )
117+ @ spec ensure_hooks_folder_exists ( ) :: any
118+ defp ensure_hooks_folder_exists do
119+ Project . deps_path ( )
120+ |> Path . join ( "/../.git/hooks" )
121+ |> File . mkdir_p ( )
118122 end
119123
120124 @ spec clean_missing_hooks ( ) :: any
You can’t perform that action at this time.
0 commit comments