start converting from System.Directory to System.OsPath

This is the start of a long road, got the first few files to compile
after this large change.

Sponsored-by: mycroft
This commit is contained in:
Joey Hess 2025-01-23 10:22:06 -04:00
parent d46504e51e
commit 05bdce328d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 185 additions and 47 deletions

View file

@ -11,6 +11,7 @@ import Utility.SafeCommand
import Utility.Env.Basic
import qualified Git.Version
import Utility.SystemDirectory
import Utility.OsPath
import Control.Monad
import Control.Applicative
@ -91,11 +92,11 @@ getSshConnectionCaching = Config "sshconnectioncaching" . BoolConfig <$>
setup :: IO ()
setup = do
createDirectoryIfMissing True tmpDir
createDirectoryIfMissing True (toOsPath tmpDir)
writeFile testFile "test file contents"
cleanup :: IO ()
cleanup = removeDirectoryRecursive tmpDir
cleanup = removeDirectoryRecursive (toOsPath tmpDir)
run :: [TestCase] -> IO ()
run ts = do

View file

@ -8,6 +8,7 @@ import Utility.Path
import Utility.Monad
import Utility.SafeCommand
import Utility.SystemDirectory
import Utility.OsPath
import System.IO
import System.FilePath
@ -106,7 +107,7 @@ findCmdPath k command = do
where
find d =
let f = d </> command
in ifM (doesFileExist f) ( return (Just f), return Nothing )
in ifM (doesFileExist (toOsPath f)) ( return (Just f), return Nothing )
quiet :: String -> String
quiet s = s ++ " >/dev/null 2>&1"

View file

@ -73,4 +73,4 @@ writeVersion ver = catchMaybeIO (F.readFile' f) >>= \case
, ""
]
footer = []
f = toOsPath "Build/Version"
f = literalOsPath "Build/Version"