diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-14 14:16:59 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-14 14:22:57 -0400 |
commit | 049b1e125c127ebb8bbe567e5efbe75b095b68bd (patch) | |
tree | af6a3dd1c8c0c496f4c85d3789d41c05e94aeaf0 | |
parent | 8896f20ef7859429c7db5612023250c17efac1f8 (diff) |
fix windows env hack
-rw-r--r-- | git-annex.hs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/git-annex.hs b/git-annex.hs index 2174965fd..a96dd8cbd 100644 --- a/git-annex.hs +++ b/git-annex.hs @@ -32,16 +32,18 @@ main = do run ps n | isshell n = CmdLine.GitAnnexShell.run ps | otherwise = -#ifdef WITH_TESTSUITE - case ps of - ("test":ps') -> Test.main ps' - _ -> CmdLine.GitAnnex.run ps -#else #ifdef mingw32_HOST_OS - winEnv CmdLine.GitAnnex.run ps + winEnv gitannex ps #else + gitannex ps #endif - CmdLine.GitAnnex.run ps + gitannex ps = +#ifdef WITH_TESTSUITE + case ps of + ("test":ps') -> Test.main ps' + _ -> CmdLine.GitAnnex.run ps +#else + CmdLine.GitAnnex.run ps #endif isshell n = takeFileName n == "git-annex-shell" @@ -61,13 +63,14 @@ winEnv a ps = go =<< getEnv "HOME" go (Just _) = a ps go Nothing = do home <- myHomeDir + putStrLn $ "** Windows hack; overrideing HOME to " ++ home e <- getEnvironment let eoverride = [ ("HOME", home) , ("CYGWIN", "nodosfilewarning") ] cmd <- readProgramFile - (_, _, _, proc) <- createProcess (proc cmd ps) + (_, _, _, pid) <- createProcess (proc cmd ps) { env = Just $ e ++ eoverride } - exitWith =<< waitForProcess proc + exitWith =<< waitForProcess pid #endif |