fix handling compressed files

This commit is contained in:
Filip Graliński 2018-06-29 16:59:00 +02:00
parent 010f0f46ab
commit 0708b746a9
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
name: geval name: geval
version: 1.1.0.0 version: 1.1.1.0
synopsis: Machine learning evaluation tools synopsis: Machine learning evaluation tools
description: Please see README.md description: Please see README.md
homepage: http://github.com/name/project homepage: http://github.com/name/project

View File

@ -336,9 +336,13 @@ checkAndGetFiles forceInput gevalSpec = do
checkMultipleOuts :: GEvalSpecification -> IO (Maybe [FilePath]) checkMultipleOuts :: GEvalSpecification -> IO (Maybe [FilePath])
checkMultipleOuts gevalSpec = do checkMultipleOuts gevalSpec = do
isSimpleOutThere <- D.doesFileExist (outTestDirectory </> outFile) -- if the out.tsv is there, just use it
outFilePath <- lookForCompressedFiles (outTestDirectory </> outFile)
isSimpleOutThere <- D.doesFileExist outFilePath
let patterns = Prelude.map (\ext -> compile ("out-*.tsv" ++ ext)) ["", ".gz", ".bz2", ".xz"] let patterns = Prelude.map (\ext -> compile ("out-*.tsv" ++ ext)) ["", ".gz", ".bz2", ".xz"]
multipleOuts <- Prelude.concat <$> globDir patterns outTestDirectory multipleOuts <- Prelude.concat <$> globDir patterns outTestDirectory
if outFile == "out.tsv" && not isSimpleOutThere && multipleOuts /= [] if outFile == "out.tsv" && not isSimpleOutThere && multipleOuts /= []
then then
return $ Just multipleOuts return $ Just multipleOuts