summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtt.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/tt.hs b/tt.hs
index 900c776..87e0041 100755
--- a/tt.hs
+++ b/tt.hs
@@ -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)