-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes mix file read failure when using cabal >= 1.22 / ghc >= 7.10 (f…
…ixes #44)
- Loading branch information
Showing
10 changed files
with
55 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ dist/ | |
*.ps | ||
*.prof | ||
*.json | ||
*.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,9 @@ | |
-- Maintainer: Guillaume Nargeot <[email protected]> | ||
-- Stability: experimental | ||
-- | ||
-- Functions for reading the cabal package name and version. | ||
-- Functions for reading cabal package name and version. | ||
|
||
module Trace.Hpc.Coveralls.Cabal (packageNameVersion) where | ||
module Trace.Hpc.Coveralls.Cabal (currDirPkgNameVer, getPackageNameVersion) where | ||
|
||
import Control.Applicative | ||
import Control.Monad | ||
|
@@ -21,8 +21,8 @@ import System.Directory | |
|
||
getCabalFile :: FilePath -> IO (Maybe FilePath) | ||
getCabalFile dir = do | ||
cnts <- (filter isCabal <$> getDirectoryContents dir) >>= filterM doesFileExist | ||
case cnts of | ||
files <- (filter isCabal <$> getDirectoryContents dir) >>= filterM doesFileExist | ||
case files of | ||
[file] -> return $ Just file | ||
_ -> return Nothing | ||
where isCabal filename = ".cabal" `isSuffixOf` filename && length filename > 6 | ||
|
@@ -38,7 +38,7 @@ getPackageNameVersion file = do | |
version = showVersion (pkgVersion pkg) | ||
showVersion = intercalate "." . map show . versionBranch | ||
|
||
packageNameVersion :: IO (Maybe String) | ||
packageNameVersion = runMaybeT $ pkgNameVersion currentDir | ||
currDirPkgNameVer :: IO (Maybe String) | ||
currDirPkgNameVer = runMaybeT $ pkgNameVersion currentDir | ||
where pkgNameVersion = MaybeT . getPackageNameVersion <=< MaybeT . getCabalFile | ||
currentDir = "." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Might be good to populate the array with the results of two calls to getMixPath: