aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2020-06-05 13:07:00 +0200
committerIgor Pashev <pashev.igor@gmail.com>2020-06-05 13:07:00 +0200
commitc8e75d707907dd23bff4309dddd6f1ed3fbacfe8 (patch)
treeccc17b0fcdb2c8a662346da242df31881dc315ff /compiler
parent7ae181e09835a38d88990f18b8f0ed42835959ee (diff)
downloadhakyll-template-c8e75d707907dd23bff4309dddd6f1ed3fbacfe8.tar.gz
Add the rebuild commandHEADmaster
Diffstat (limited to 'compiler')
-rw-r--r--compiler/site/Main.hs18
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