summaryrefslogtreecommitdiff
path: root/Utility/Directory.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-05-22 15:51:31 -0400
committerSean Whitton <spwhitton@spwhitton.name>2017-07-25 17:19:31 -0700
commite306cd8521a88c1cc39c926177a184adf9524886 (patch)
tree1b536b7e43faad408c6e85cc6ec002d93344b491 /Utility/Directory.hs
parent1ecd24cc076b15e085529d41e5a873e334f75167 (diff)
downloadgit-repair-e306cd8521a88c1cc39c926177a184adf9524886.tar.gz
split out module to work around badly named symbol in directory-1.2.6.2
Sadly my bug report about this is not going to get fixed it seems, so I have to drag around a whole added module file just to deal with it. https://github.com/haskell/directory/issues/52
Diffstat (limited to 'Utility/Directory.hs')
-rw-r--r--Utility/Directory.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Utility/Directory.hs b/Utility/Directory.hs
index fae33b5..693e771 100644
--- a/Utility/Directory.hs
+++ b/Utility/Directory.hs
@@ -8,10 +8,12 @@
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
-module Utility.Directory where
+module Utility.Directory (
+ module Utility.Directory,
+ module Utility.SystemDirectory
+) where
import System.IO.Error
-import System.Directory
import Control.Monad
import System.FilePath
import Control.Applicative
@@ -28,6 +30,7 @@ import Utility.SafeCommand
import Control.Monad.IfElse
#endif
+import Utility.SystemDirectory
import Utility.PosixFiles
import Utility.Tmp
import Utility.Exception
@@ -134,11 +137,13 @@ moveFile src dest = tryIO (rename src dest) >>= onrename
_ <- tryIO $ removeFile tmp
throwM e'
+#ifndef mingw32_HOST_OS
isdir f = do
r <- tryIO $ getFileStatus f
case r of
(Left _) -> return False
(Right s) -> return $ isDirectory s
+#endif
{- Removes a file, which may or may not exist, and does not have to
- be a regular file.