diff options
author | stuebinm | 2021-09-23 03:01:09 +0200 |
---|---|---|
committer | stuebinm | 2021-09-23 03:01:09 +0200 |
commit | 7e77e6335bab772c4be1b3f0594113d09cd4a366 (patch) | |
tree | aa2e45b84b4b3ec17d562fd80276a307e6e88267 /src | |
parent | 7ad5e1cd504b1d57ff3660f9eb81d2e7072ea4bf (diff) |
handle all maps in entire repositories
(+ checking that paths don't run outside of respositories)
Diffstat (limited to 'src')
-rw-r--r-- | src/Main.hs | 15 |
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 |