From c8e75d707907dd23bff4309dddd6f1ed3fbacfe8 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Fri, 5 Jun 2020 13:07:00 +0200 Subject: Add the rebuild command --- compiler/site/Main.hs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'compiler/site') 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 -- cgit v1.2.3