From 2e032a5210d5166a42797ee8f296ec4228d6d838 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Mon, 23 Oct 2023 10:08:49 +0200 Subject: add `Git.getRootDir` --- app/Git.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/Git.hs') diff --git a/app/Git.hs b/app/Git.hs index 7891288..c72edea 100644 --- a/app/Git.hs +++ b/app/Git.hs @@ -1,6 +1,7 @@ module Git ( withWorkingTree, getCommitHashes, + getRootDir, ) where @@ -22,3 +23,6 @@ withWorkingTree path hash action = do getCommitHashes :: IO [T.Text] getCommitHashes = T.lines . T.decodeUtf8 . LB8.toStrict <$> sh "git log --format=%H" + +getRootDir :: IO FilePath +getRootDir = T.unpack . T.decodeUtf8 . LB8.toStrict <$> sh (proc "git rev-parse --show-toplevel") -- cgit v1.2.3