summaryrefslogtreecommitdiff
path: root/GitAnnexShell.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <id@joeyh.name>2013-05-11 15:03:00 -0500
committerGravatar Joey Hess <id@joeyh.name>2013-05-11 15:03:00 -0500
commitd0fa82fb721cdc85438287e29a94cb796b7bc464 (patch)
tree26a2486b8e715b5937ce41679eafd42c02f2310a /GitAnnexShell.hs
parent679eaf6077375c5d59501d12c79e0891cbdd904f (diff)
git-annex now builds on Windows (doesn't work)
Diffstat (limited to 'GitAnnexShell.hs')
-rwxr-xr-xGitAnnexShell.hs10
1 files changed, 3 insertions, 7 deletions
diff --git a/GitAnnexShell.hs b/GitAnnexShell.hs
index df0bf4c5d..6f03ac73b 100755
--- a/GitAnnexShell.hs
+++ b/GitAnnexShell.hs
@@ -5,13 +5,9 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-{-# LANGUAGE CPP #-}
-
module GitAnnexShell where
-#ifndef mingw32_HOST_OS
-import System.Posix.Env
-#endif
+import System.Environment
import System.Console.GetOpt
import Common.Annex
@@ -149,7 +145,7 @@ checkNotReadOnly cmd
checkDirectory :: Maybe FilePath -> IO ()
checkDirectory mdir = do
- v <- getEnv "GIT_ANNEX_SHELL_DIRECTORY"
+ v <- catchMaybeIO $ getEnv "GIT_ANNEX_SHELL_DIRECTORY"
case (v, mdir) of
(Nothing, _) -> noop
(Just d, Nothing) -> req d Nothing
@@ -179,7 +175,7 @@ checkDirectory mdir = do
checkEnv :: String -> IO ()
checkEnv var = do
- v <- getEnv var
+ v <- catchMaybeIO $ getEnv var
case v of
Nothing -> noop
Just "" -> noop