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