summaryrefslogtreecommitdiff
path: root/Biz/Namespace.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-03-30 14:33:32 -0400
committerBen Sima <ben@bsima.me>2022-03-30 14:33:32 -0400
commitb0c707e6f1fc03280ab45e34bec199740469e539 (patch)
tree583d7b6ee8edeecf856ba2200d5896575bd34391 /Biz/Namespace.hs
parent377acdcc31e244153da7a4ef9af0638a6d496a1e (diff)
Add isCab function
Diffstat (limited to 'Biz/Namespace.hs')
-rw-r--r--Biz/Namespace.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Biz/Namespace.hs b/Biz/Namespace.hs
index c3252fd..2312271 100644
--- a/Biz/Namespace.hs
+++ b/Biz/Namespace.hs
@@ -13,6 +13,7 @@ module Biz.Namespace
toPath,
toHaskellModule,
toSchemeModule,
+ isCab,
)
where
@@ -86,3 +87,9 @@ reExt =
<|> Sh <$ Regex.string "sh"
<|> Keys <$ Regex.string "pub"
<|> Json <$ Regex.string "json"
+
+-- | The cab dir is for temporary files and build outputs, not for source
+-- inputs.
+isCab :: FilePath -> Bool
+isCab ('_' : _) = True
+isCab fp = "_" `List.isInfixOf` fp