more RawFilePath conversion
nukeFile replaced with removeWhenExistsWith removeLink, which allows using RawFilePath. Utility.Directory cannot use RawFilePath since setup does not depend on posix. This commit was sponsored by Graham Spencer on Patreon.
This commit is contained in:
parent
8d66f7ba0f
commit
e505c03bcc
51 changed files with 182 additions and 153 deletions
|
@ -220,7 +220,7 @@ upgradeToDistribution newdir cleanup distributionfile = do
|
|||
error $ "did not find " ++ dir ++ " in " ++ distributionfile
|
||||
makeorigsymlink olddir = do
|
||||
let origdir = parentDir olddir </> installBase
|
||||
nukeFile origdir
|
||||
removeWhenExistsWith removeLink origdir
|
||||
createSymbolicLink newdir origdir
|
||||
|
||||
{- Finds where the old version was installed. -}
|
||||
|
@ -278,8 +278,8 @@ installBase = "git-annex." ++
|
|||
deleteFromManifest :: FilePath -> IO ()
|
||||
deleteFromManifest dir = do
|
||||
fs <- map (dir </>) . lines <$> catchDefaultIO "" (readFile manifest)
|
||||
mapM_ nukeFile fs
|
||||
nukeFile manifest
|
||||
mapM_ (removeWhenExistsWith removeLink) fs
|
||||
removeWhenExistsWith removeLink manifest
|
||||
removeEmptyRecursive dir
|
||||
where
|
||||
manifest = dir </> "git-annex.MANIFEST"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue