don't change the current directory
This commit is contained in:
parent
bf7d79773a
commit
3c2436ec82
21
Cabal.hs
21
Cabal.hs
@ -39,13 +39,11 @@ initializeGHC opt fileName ghcOptions logging = withCabal ||> withoutCabal
|
|||||||
exts = map (addX . Gap.extensionToString) exts'
|
exts = map (addX . Gap.extensionToString) exts'
|
||||||
lang = maybe "-XHaskell98" (addX . show) mlang
|
lang = maybe "-XHaskell98" (addX . show) mlang
|
||||||
gopts = ghcOptions ++ exts ++ [lang]
|
gopts = ghcOptions ++ exts ++ [lang]
|
||||||
changeToCabalDirectory cdir
|
idirs = case idirs' of
|
||||||
let idirs = case idirs' of
|
|
||||||
[] -> [cdir,owdir]
|
[] -> [cdir,owdir]
|
||||||
dirs -> dirs ++ [owdir]
|
dirs -> map (cdir </>) dirs ++ [owdir]
|
||||||
file = ajustFileName fileName owdir cdir
|
|
||||||
logReader <- initSession opt gopts idirs logging
|
logReader <- initSession opt gopts idirs logging
|
||||||
return (file,logReader)
|
return (fileName,logReader)
|
||||||
addX = ("-X" ++)
|
addX = ("-X" ++)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
@ -69,19 +67,6 @@ extractBuildInfo binfo = (hsSourceDirs binfo
|
|||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
ajustFileName :: FilePath -> FilePath -> FilePath -> FilePath
|
|
||||||
ajustFileName name olddir newdir
|
|
||||||
| olen == nlen = name
|
|
||||||
| otherwise = drop (nlen+1) olddir </> name
|
|
||||||
where
|
|
||||||
olen = length olddir
|
|
||||||
nlen = length newdir
|
|
||||||
|
|
||||||
changeToCabalDirectory :: FilePath -> Ghc ()
|
|
||||||
changeToCabalDirectory dir = do
|
|
||||||
liftIO $ setCurrentDirectory dir
|
|
||||||
workingDirectoryChanged
|
|
||||||
|
|
||||||
-- CurrentWorkingDir, CabalDir, CabalFile
|
-- CurrentWorkingDir, CabalDir, CabalFile
|
||||||
getDirs :: IO (FilePath,FilePath,FilePath)
|
getDirs :: IO (FilePath,FilePath,FilePath)
|
||||||
getDirs = do
|
getDirs = do
|
||||||
|
Loading…
Reference in New Issue
Block a user