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.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Propellor/Gpg.hs b/src/Propellor/Gpg.hs
index 86f84dc1..24743d40 100644
--- a/src/Propellor/Gpg.hs
+++ b/src/Propellor/Gpg.hs
@@ -14,6 +14,7 @@ import Utility.Process
import Utility.Monad
import Utility.Misc
import Utility.Tmp
+import Utility.FileSystemEncoding
type KeyId = String
@@ -112,8 +113,9 @@ gpgEncrypt f s = do
, "--encrypt"
, "--trust-model", "always"
] ++ concatMap (\k -> ["--recipient", k]) keyids
- encrypted <- writeReadProcessEnv "gpg" opts
- Nothing
- (Just $ flip hPutStr s)
- Nothing
+ encrypted <- writeReadProcessEnv "gpg" opts Nothing (Just writer) Nothing
viaTmp writeFile f encrypted
+ where
+ writer h = do
+ fileEncoding h
+ hPutStr h s