From 753cdfe8c18b470da4a4807815d0aaade53f1d16 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 5 Feb 2021 21:56:20 -0500 Subject: Add 'tidy' to Plan This is supposed to be how to cleanup the database and any other local files. Should only be used before/after test, so maybe I can find a way to enforce this constraint somehow in the code. --- Biz/Devalloc.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Biz/Devalloc.hs') diff --git a/Biz/Devalloc.hs b/Biz/Devalloc.hs index bdb958f..9bc8bd0 100644 --- a/Biz/Devalloc.hs +++ b/Biz/Devalloc.hs @@ -397,7 +397,7 @@ init = -- * main and test main :: IO () -main = Cli.main <| Cli.Plan help move test +main = Cli.main <| Cli.Plan help move test tidy help :: Cli.Docopt help = @@ -435,6 +435,9 @@ startup = do shutdown :: (Config, Application, Acid.AcidState Keep) -> IO () shutdown (_, _, kp) = Acid.closeAcidState kp +tidy :: Config -> IO () +tidy Config {..} = Directory.removeDirectoryRecursive keep + run :: (Config, Wai.Application, Acid.AcidState Keep) -> IO () run (cfg, app, _) = Warp.run (port cfg) (logStdout app) -- cgit v1.2.3