diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2020-06-05 13:07:00 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2020-06-05 13:07:00 +0200 |
commit | c8e75d707907dd23bff4309dddd6f1ed3fbacfe8 (patch) | |
tree | ccc17b0fcdb2c8a662346da242df31881dc315ff | |
parent | 7ae181e09835a38d88990f18b8f0ed42835959ee (diff) | |
download | hakyll-template-master.tar.gz |
-rw-r--r-- | compiler/site/Main.hs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/compiler/site/Main.hs b/compiler/site/Main.hs index e7fb92f..351c0b8 100644 --- a/compiler/site/Main.hs +++ b/compiler/site/Main.hs @@ -17,6 +17,7 @@ import Rules (rules) data Command = Build | Clean + | Rebuild | Check Cmd.Check parseCheck :: O.Parser Cmd.Check @@ -31,17 +32,19 @@ parseCommand = O.subparser $ O.command "build" (O.info (pure Build) (O.progDesc "Build the site")) <> O.command "clean" (O.info (pure Clean) (O.progDesc "Clean")) <> + O.command "rebuild" (O.info (pure Rebuild) (O.progDesc "Clean build")) <> O.command "check" (O.info ((Check <$> parseCheck) <**> O.helper) (O.progDesc "Check links")) -data Options = Options - { verbose :: Bool - , outDir :: FilePath - , srcDir :: FilePath - , cacheDir :: FilePath - , command :: Command - } +data Options = + Options + { verbose :: Bool + , outDir :: FilePath + , srcDir :: FilePath + , cacheDir :: FilePath + , command :: Command + } parseOptions :: O.Parser Options parseOptions = @@ -83,4 +86,5 @@ main = do case command opts of Build -> Cmd.build conf log rules >>= exitWith Clean -> Cmd.clean conf log + Rebuild -> Cmd.clean conf log >> Cmd.build conf log rules >>= exitWith Check chk -> Cmd.check conf log chk >>= exitWith |