summaryrefslogtreecommitdiff
path: root/src/Propellor/PrivData.hs
diff options
context:
space:
mode:
authorJoey Hess2015-10-20 23:37:21 -0400
committerJoey Hess2015-10-20 23:37:21 -0400
commit0e39d53352b982022747e451676bc6a66e3d9acc (patch)
tree37f84bb464b71437d7ff90c571d1f127a8127edb /src/Propellor/PrivData.hs
parent745f42c1499749345c32736342959584587c9b57 (diff)
refactor
Diffstat (limited to 'src/Propellor/PrivData.hs')
-rw-r--r--src/Propellor/PrivData.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs
index 070070f0..aac37d14 100644
--- a/src/Propellor/PrivData.hs
+++ b/src/Propellor/PrivData.hs
@@ -17,6 +17,7 @@ module Propellor.PrivData (
makePrivDataDir,
decryptPrivData,
readPrivData,
+ readPrivDataFile,
PrivMap,
PrivInfo,
forceHostContext,
@@ -254,6 +255,9 @@ decryptPrivData = readPrivData <$> gpgDecrypt privDataFile
readPrivData :: String -> PrivMap
readPrivData = fromMaybe M.empty . readish
+readPrivDataFile :: FilePath -> IO PrivMap
+readPrivDataFile f = readPrivData <$> readFileStrictAnyEncoding f
+
makePrivDataDir :: IO ()
makePrivDataDir = createDirectoryIfMissing False privDataDir