work around windows insanity that is 97.61% more brain-damaged than normal
This commit is contained in:
parent
8befeaffa0
commit
a96118ec55
2 changed files with 12 additions and 0 deletions
|
@ -5,6 +5,8 @@
|
||||||
- Licensed under the GNU GPL version 3 or higher.
|
- Licensed under the GNU GPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
{-# LANGUAGE CPP #-}
|
||||||
|
|
||||||
module Utility.Tmp where
|
module Utility.Tmp where
|
||||||
|
|
||||||
import Control.Exception (bracket)
|
import Control.Exception (bracket)
|
||||||
|
@ -62,7 +64,15 @@ withTmpDirIn :: FilePath -> Template -> (FilePath -> IO a) -> IO a
|
||||||
withTmpDirIn tmpdir template = bracket create remove
|
withTmpDirIn tmpdir template = bracket create remove
|
||||||
where
|
where
|
||||||
remove d = whenM (doesDirectoryExist d) $
|
remove d = whenM (doesDirectoryExist d) $
|
||||||
|
#if mingw32_HOST_OS
|
||||||
|
-- Windows will often refuse to delete a file
|
||||||
|
-- after a process has just written to it and exited.
|
||||||
|
-- Because it's crap, presumably. So, ignore failure
|
||||||
|
-- to delete the temp directory.
|
||||||
|
catchIO $ removeDirectoryRecursive d
|
||||||
|
#else
|
||||||
removeDirectoryRecursive d
|
removeDirectoryRecursive d
|
||||||
|
#endif
|
||||||
create = do
|
create = do
|
||||||
createDirectoryIfMissing True tmpdir
|
createDirectoryIfMissing True tmpdir
|
||||||
makenewdir (tmpdir </> template) (0 :: Int)
|
makenewdir (tmpdir </> template) (0 :: Int)
|
||||||
|
|
|
@ -8,3 +8,5 @@ Create a remote repository
|
||||||
|
|
||||||
### What version of git-annex are you using? On what operating system?
|
### What version of git-annex are you using? On what operating system?
|
||||||
Windows 7, git-annex version 5.20131221-gf8c928d
|
Windows 7, git-annex version 5.20131221-gf8c928d
|
||||||
|
|
||||||
|
> [[fixed|done]].. thanks for testing the assistant on windows! --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue