summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 33db91c..41f5da6 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -15,16 +15,15 @@ import Data.Text.Lazy as T
import System.IO (utf8)
import WithCli
-import CheckMap (loadAndLintMap)
import Util (printPretty)
import CheckDir (recursiveCheckDir)
-- | the options this cli tool can take
data Options = Options
- { inpath :: Maybe String
- -- ^ path to input map files
- , outpath :: Maybe String
- -- ^ path to out directory (should be empty)
+ { repository :: Maybe String
+ -- ^ path to the repository containing maps to lint
+ , entrypoint :: Maybe String
+ -- ^ entrypoint in that repository
, allowScripts :: Bool
-- ^ pass --allowScripts to allow javascript in map
, scriptInject :: Maybe String
@@ -41,8 +40,10 @@ main = withCli run
run :: Options -> IO ()
run options = do
- --lints <- loadAndLintMap (fromMaybe "example.json" (inpath options))
- lints <- recursiveCheckDir (fromMaybe "example.json" (inpath options))
+ let repo = fromMaybe "." (repository options)
+ let entry = fromMaybe "main.json" (entrypoint options)
+
+ lints <- recursiveCheckDir repo entry
if json options
then printLB