more OsPath conversion
Git.Types now uses it, as does TopFilePath, making for plenty of new compile errors needing fixing. Sponsored-by: Brock Spratlen
This commit is contained in:
parent
12660314f1
commit
ea775baccd
22 changed files with 159 additions and 163 deletions
|
@ -9,28 +9,27 @@
|
|||
|
||||
module Config.Files where
|
||||
|
||||
import Common
|
||||
import Utility.FreeDesktop
|
||||
import Utility.Exception
|
||||
|
||||
import System.FilePath
|
||||
|
||||
{- ~/.config/git-annex/file -}
|
||||
userConfigFile :: FilePath -> IO FilePath
|
||||
userConfigFile :: OsPath -> IO OsPath
|
||||
userConfigFile file = do
|
||||
dir <- userConfigDir
|
||||
return $ dir </> "git-annex" </> file
|
||||
dir <- toOsPath <$> userConfigDir
|
||||
return $ dir </> literalOsPath "git-annex" </> file
|
||||
|
||||
autoStartFile :: IO FilePath
|
||||
autoStartFile = userConfigFile "autostart"
|
||||
autoStartFile :: IO OsPath
|
||||
autoStartFile = userConfigFile (literalOsPath "autostart")
|
||||
|
||||
{- The path to git-annex is written here; which is useful when something
|
||||
- has installed it to some awful non-PATH location. -}
|
||||
programFile :: IO FilePath
|
||||
programFile = userConfigFile "program"
|
||||
programFile :: IO OsPath
|
||||
programFile = userConfigFile (literalOsPath "program")
|
||||
|
||||
{- A .noannex file in a git repository prevents git-annex from
|
||||
- initializing that repository. The content of the file is returned. -}
|
||||
noAnnexFileContent :: Maybe FilePath -> IO (Maybe String)
|
||||
noAnnexFileContent :: Maybe OsPath -> IO (Maybe String)
|
||||
noAnnexFileContent repoworktree = case repoworktree of
|
||||
Nothing -> return Nothing
|
||||
Just wt -> catchMaybeIO (readFile (wt </> ".noannex"))
|
||||
Just wt -> catchMaybeIO (readFile (fromOsPath (wt </> literalOsPath ".noannex")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue