summaryrefslogtreecommitdiff
path: root/src/Propellor/PrivData.hs
diff options
context:
space:
mode:
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