From f2dabfcec427218794de80d496ed177a14d8767f Mon Sep 17 00:00:00 2001 From: Key Carson Date: Mon, 5 Mar 2018 11:35:46 -0600 Subject: [PATCH] create git hooks directory if it doesn't exist --- lib/pre_commit.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pre_commit.ex b/lib/pre_commit.ex index 8c7d5ac..eb104de 100644 --- a/lib/pre_commit.ex +++ b/lib/pre_commit.ex @@ -46,6 +46,10 @@ defmodule PreCommit do copy = Mix.Project.deps_path() |> Path.join("pre_commit/priv/pre-commit") to = Mix.Project.deps_path() |> Path.join("../.git/hooks/pre-commit") + unless File.exists?(to) do + File.mkdir!(to) + end + copy |> File.copy(to)