convert from readFileStrict
This removes that function, using file-io readFile' instead. Had to deal with newline conversion, which readFileStrict does on Windows. In a few cases, that was pretty ugly to deal with. Sponsored-by: Kevin Mueller
This commit is contained in:
parent
de1af273e0
commit
6e27b0d4d1
19 changed files with 94 additions and 71 deletions
|
@ -34,6 +34,7 @@ import Data.Char
|
|||
import Data.Ord
|
||||
import Data.Either
|
||||
import System.PosixCompat.Files (groupWriteMode, otherWriteMode)
|
||||
import qualified Data.ByteString.Char8 as S8
|
||||
|
||||
data SshConfig
|
||||
= GlobalConfig SshSetting
|
||||
|
@ -135,7 +136,8 @@ changeUserSshConfig modifier = do
|
|||
sshdir <- sshDir
|
||||
let configfile = sshdir </> "config"
|
||||
whenM (doesFileExist configfile) $ do
|
||||
c <- readFileStrict configfile
|
||||
c <- decodeBS . S8.unlines . fileLines'
|
||||
<$> F.readFile' (toOsPath (toRawFilePath configfile))
|
||||
let c' = modifier c
|
||||
when (c /= c') $ do
|
||||
-- If it's a symlink, replace the file it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue