fix windows env hack
This commit is contained in:
parent
01b07a9ca6
commit
7bfb815797
1 changed files with 12 additions and 9 deletions
21
git-annex.hs
21
git-annex.hs
|
@ -32,16 +32,18 @@ main = do
|
||||||
run ps n
|
run ps n
|
||||||
| isshell n = CmdLine.GitAnnexShell.run ps
|
| isshell n = CmdLine.GitAnnexShell.run ps
|
||||||
| otherwise =
|
| otherwise =
|
||||||
#ifdef WITH_TESTSUITE
|
|
||||||
case ps of
|
|
||||||
("test":ps') -> Test.main ps'
|
|
||||||
_ -> CmdLine.GitAnnex.run ps
|
|
||||||
#else
|
|
||||||
#ifdef mingw32_HOST_OS
|
#ifdef mingw32_HOST_OS
|
||||||
winEnv CmdLine.GitAnnex.run ps
|
winEnv gitannex ps
|
||||||
#else
|
#else
|
||||||
|
gitannex ps
|
||||||
#endif
|
#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
|
#endif
|
||||||
isshell n = takeFileName n == "git-annex-shell"
|
isshell n = takeFileName n == "git-annex-shell"
|
||||||
|
|
||||||
|
@ -61,13 +63,14 @@ winEnv a ps = go =<< getEnv "HOME"
|
||||||
go (Just _) = a ps
|
go (Just _) = a ps
|
||||||
go Nothing = do
|
go Nothing = do
|
||||||
home <- myHomeDir
|
home <- myHomeDir
|
||||||
|
putStrLn $ "** Windows hack; overrideing HOME to " ++ home
|
||||||
e <- getEnvironment
|
e <- getEnvironment
|
||||||
let eoverride =
|
let eoverride =
|
||||||
[ ("HOME", home)
|
[ ("HOME", home)
|
||||||
, ("CYGWIN", "nodosfilewarning")
|
, ("CYGWIN", "nodosfilewarning")
|
||||||
]
|
]
|
||||||
cmd <- readProgramFile
|
cmd <- readProgramFile
|
||||||
(_, _, _, proc) <- createProcess (proc cmd ps)
|
(_, _, _, pid) <- createProcess (proc cmd ps)
|
||||||
{ env = Just $ e ++ eoverride }
|
{ env = Just $ e ++ eoverride }
|
||||||
exitWith =<< waitForProcess proc
|
exitWith =<< waitForProcess pid
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue