diff options
author | Andrew Cady <d@jerkface.net> | 2019-07-11 11:44:14 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2019-07-11 11:50:11 -0400 |
commit | a2cfd42e569e2f8d0a7011573f72ba0876ae16e8 (patch) | |
tree | a5bb3b0a62279221d0457215e50263e0a8e58de6 /lib/Kiki.hs | |
parent | ce6bd99d43a3d7c77cbec0272da1abd071b5bd5d (diff) |
fix whitespace
Diffstat (limited to 'lib/Kiki.hs')
-rw-r--r-- | lib/Kiki.hs | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/Kiki.hs b/lib/Kiki.hs index 2af7779..d6a8b3a 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs | |||
@@ -371,28 +371,29 @@ ipsecCertPath = ipsecPath "certs" | |||
371 | makeFileWriter :: (FilePath -> FilePath) -> (IO ()) -> FileWriter | 371 | makeFileWriter :: (FilePath -> FilePath) -> (IO ()) -> FileWriter |
372 | makeFileWriter p c = | 372 | makeFileWriter p c = |
373 | FileWriter | 373 | FileWriter |
374 | { pathMaker = p | 374 | { pathMaker = p |
375 | , fileWriterCommit = c | 375 | , fileWriterCommit = c |
376 | , write = write' writeFile | 376 | , write = write' writeFile |
377 | , writeL = write' L.writeFile | 377 | , writeL = write' L.writeFile |
378 | , writeL077 = | 378 | , writeL077 = |
379 | \f bs -> do | 379 | \f bs -> do |
380 | old_umask <- setFileCreationMask 0o077 | 380 | old_umask <- setFileCreationMask 0o077 |
381 | write' L.writeFile f bs | 381 | write' L.writeFile f bs |
382 | setFileCreationMask old_umask | 382 | setFileCreationMask old_umask |
383 | } | 383 | } |
384 | where | 384 | where |
385 | write' wr (p -> f) bs = do | 385 | write' wr (p -> f) bs = do |
386 | createDirectoryIfMissing True $ takeDirectory f | 386 | createDirectoryIfMissing True $ takeDirectory f |
387 | wr f bs | 387 | wr f bs |
388 | 388 | ||
389 | data FileWriter = FileWriter { | 389 | data FileWriter = |
390 | pathMaker :: FilePath -> FilePath, | 390 | FileWriter |
391 | fileWriterCommit :: IO (), | 391 | { pathMaker :: FilePath -> FilePath |
392 | write :: FilePath -> String -> IO (), | 392 | , fileWriterCommit :: IO () |
393 | writeL :: FilePath -> Char8.ByteString -> IO (), | 393 | , write :: FilePath -> String -> IO () |
394 | writeL077 :: FilePath -> Char8.ByteString -> IO FileMode | 394 | , writeL :: FilePath -> Char8.ByteString -> IO () |
395 | } | 395 | , writeL077 :: FilePath -> Char8.ByteString -> IO FileMode |
396 | } | ||
396 | 397 | ||
397 | getMkPathAndCommit :: FilePath -> IO (FileWriter) | 398 | getMkPathAndCommit :: FilePath -> IO (FileWriter) |
398 | getMkPathAndCommit destdir = do | 399 | getMkPathAndCommit destdir = do |