diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-23 18:48:52 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-23 18:48:52 -0400 |
| commit | 9d975e9ee4c44782da0815fb161ea8676dbf559c (patch) | |
| tree | b74c1037324cdc4308c98e475202649bf91e27df /src/Propellor/Gpg.hs | |
| parent | baba668033f86b7c91f6b15c58002ea4bdbf3da2 (diff) | |
add --merge
Diffstat (limited to 'src/Propellor/Gpg.hs')
| -rw-r--r-- | src/Propellor/Gpg.hs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Propellor/Gpg.hs b/src/Propellor/Gpg.hs index 572be190..86f84dc1 100644 --- a/src/Propellor/Gpg.hs +++ b/src/Propellor/Gpg.hs @@ -83,14 +83,18 @@ addKey keyid = exitBool =<< allM (uncurry actionMessage) , Param "propellor addkey" ] +-- Adds --gpg-sign if there's a keyring. +gpgSignParams :: [CommandParam] -> IO [CommandParam] +gpgSignParams ps = ifM (doesFileExist keyring) + ( return (ps ++ [Param "--gpg-sign"]) + , return ps + ) + -- Automatically sign the commit if there'a a keyring. gitCommit :: [CommandParam] -> IO Bool gitCommit ps = do - k <- doesFileExist keyring - boolSystem "git" $ catMaybes $ - [ Just (Param "commit") - , if k then Just (Param "--gpg-sign") else Nothing - ] ++ map Just ps + ps' <- gpgSignParams ps + boolSystem "git" (Param "commit" : ps') gpgDecrypt :: FilePath -> IO String gpgDecrypt f = ifM (doesFileExist f) |
