summaryrefslogtreecommitdiff
path: root/src/Propellor/Gpg.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Gpg.hs')
-rw-r--r--src/Propellor/Gpg.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Propellor/Gpg.hs b/src/Propellor/Gpg.hs
index 4c7ccc9c..d3550e88 100644
--- a/src/Propellor/Gpg.hs
+++ b/src/Propellor/Gpg.hs
@@ -13,6 +13,7 @@ import Prelude
import Propellor.PrivData.Paths
import Propellor.Message
+import Propellor.Git.Config
import Utility.SafeCommand
import Utility.Process
import Utility.Monad
@@ -21,11 +22,15 @@ import Utility.Tmp
import Utility.FileSystemEncoding
import Utility.Env
-getGpgBin :: IO String
-getGpgBin = getEnvDefault "GNUPGBIN" "gpg"
-
type KeyId = String
+getGpgBin :: IO String
+getGpgBin = do
+ gitGpgBin <- getGitConfigValue "gpg.program"
+ case gitGpgBin of
+ Nothing -> getEnvDefault "GNUPGBIN" "gpg"
+ Just b -> return b
+
keyring :: FilePath
keyring = privDataDir </> "keyring.gpg"