diff options
-rwxr-xr-x | tt.hs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -127,11 +127,15 @@ isPython s = isSuffixOf ".py" s && head s /= '.' expand :: FilePath -> Bool -> String -> IO [String] expand testDir inTree s | isPython s = return [s] - | "/" `isSuffixOf` s = do + | otherwise = do let srcdir = if inTree then "." else ".." dir = srcdir </> testDir </> s - (map (s ++) . filter isPython) <$> getDirectoryContents dir - | otherwise = return [s ++ ".py"] + + isDirectory <- doesDirectoryExist dir + + if isDirectory + then (map (s </>) . filter isPython) <$> getDirectoryContents dir + else return [s ++ ".py"] {- Stupid project-specific crap detection -} iFuckingHateMissionControl :: IO (Maybe String) |