dotfiles/overlays/photo-hs/lib/Git/Annex.hs
magic_rb 62f4255e6f
Publish photo-hs
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-07-13 21:11:48 +02:00

30 lines
751 B
Haskell

module Git.Annex
( gitAnnexAdd
, gitAnnexInit
) where
import Control.Monad.IO.Class (MonadIO)
import System.Process.Typed (proc, runProcess, ExitCode (..), setWorkingDir)
import Data.Function ((&))
gitAnnexAdd :: (MonadIO m) => FilePath -> FilePath -> m ()
gitAnnexAdd repositoryPath filePath = do
let
pc
= proc "git" [ "annex", "add", filePath ]
& setWorkingDir repositoryPath
runProcess pc >>= \case
ExitSuccess -> pure ()
ExitFailure code -> undefined
gitAnnexInit :: (MonadIO m) => FilePath -> m ()
gitAnnexInit repositoryPath = do
let
pc
= proc "git" [ "annex", "init" ]
& setWorkingDir repositoryPath
runProcess pc >>= \case
ExitSuccess -> pure ()
ExitFailure code -> undefined