diff options
author | Fabian Kirchner <kirchner@posteo.de> | 2023-10-02 15:21:08 +0200 |
---|---|---|
committer | Fabian Kirchner <kirchner@posteo.de> | 2023-10-02 15:21:08 +0200 |
commit | 4b9b932834860add4ef8fcd7618f2867902fcbd4 (patch) | |
tree | 44fa5e180231daccde130d1e707459c8e882189d /app/Main.hs | |
parent | 737bf192f4b74104b7e8f78ed9732e70aa44a5da (diff) |
get list of files which should be checked
Diffstat (limited to 'app/Main.hs')
-rw-r--r-- | app/Main.hs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/Main.hs b/app/Main.hs index e3c1a28..351bcac 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,7 +1,12 @@ +{-# LANGUAGE OverloadedStrings #-} + module Main where +import Data.ByteString.Lazy (ByteString) +import Data.ByteString.Lazy qualified as LB import Options.Applicative ((<**>)) import Options.Applicative qualified as O +import System.Process.Typed qualified as P data Options = Options { optCommand :: Command @@ -36,4 +41,10 @@ showCommandParser = main :: IO () main = do options <- O.execParser (O.info (commandParser <**> O.helper) O.idm) - print options + files <- getFiles + print files + +getFiles :: IO [ByteString] +getFiles = + fmap (LB.split 10 . snd) $ + P.readProcessStdout "git ls-files --cached --exclude-standard --other" |