mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-12 18:01:59 +01:00
62f4255e6f
Signed-off-by: magic_rb <magic_rb@redalder.org>
30 lines
751 B
Haskell
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
|