mostly finished with createDirectoryUnder conversion

Remaining things needing converted are in the assistant, and Annex.Ssh.

Every other remaining call to createDirectoryIfMissing True has been
audited and is not relevant. The ones in Build/ of course don't get
included in the program. Others included eg, Remote.Tahoe and
Config.Files which both write to dotfiles under the home directory.
This commit is contained in:
Joey Hess 2020-03-06 11:57:15 -04:00
parent 2f204b5d37
commit 7f992ef59c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
11 changed files with 30 additions and 23 deletions

View file

@ -13,6 +13,7 @@ import Command
import qualified Annex
import qualified Git.Config
import Config
import Annex.Perms
import Utility.ThreadScheduler
import Utility.DiskFree
import Git.Types (fromConfigKey)
@ -172,10 +173,10 @@ instance Arbitrary FuzzAction where
]
runFuzzAction :: FuzzAction -> Annex ()
runFuzzAction (FuzzAdd (FuzzFile f)) = liftIO $ do
createDirectoryIfMissing True $ parentDir f
n <- getStdRandom random :: IO Int
writeFile f $ show n ++ "\n"
runFuzzAction (FuzzAdd (FuzzFile f)) = do
createWorkTreeDirectory (parentDir f)
n <- liftIO (getStdRandom random :: IO Int)
liftIO $ writeFile f $ show n ++ "\n"
runFuzzAction (FuzzDelete (FuzzFile f)) = liftIO $ nukeFile f
runFuzzAction (FuzzMove (FuzzFile src) (FuzzFile dest)) = liftIO $
rename src dest