Skip to content

Commit 2974370

Browse files
committed
Allow setting up a custom project path
This will add flexibility when the dependency it's placed in a external path outside the original repository
1 parent 2455538 commit 2974370

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/git/path.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ defmodule GitHooks.Git.Path do
1515
resolve_git_path_based_on_git_version()
1616
|> Path.dirname()
1717

18-
Path.relative_to(File.cwd!(), repo_path)
18+
project_path = Application.get_env(:git_hooks, :project_path, File.cwd!())
19+
20+
Path.relative_to(project_path, repo_path)
1921
end
2022

2123
@spec git_hooks_path_for(path :: String.t()) :: String.t()

0 commit comments

Comments
 (0)