diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-29 14:45:19 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-29 14:45:19 -0400 |
commit | 992eb6d6931cfc2ca8da0fe2d25e58742ce8cd77 (patch) | |
tree | cb1b35a324ee240fc2291b847e96e46944e5fbfc /Command/WebApp.hs | |
parent | a2acf0ed7f27bf4ce37be39d1c5f47c414183ead (diff) |
convert notBareRepo to a CommandCheck
This avoids some small overhead by only running the check once per command;
it also ensures that, even if the command doesn't find anything to run on,
it still fails to run when in a bare repo.
Diffstat (limited to 'Command/WebApp.hs')
-rw-r--r-- | Command/WebApp.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Command/WebApp.hs b/Command/WebApp.hs index 11ba23d83..581d6d4dd 100644 --- a/Command/WebApp.hs +++ b/Command/WebApp.hs @@ -29,7 +29,7 @@ import Control.Concurrent import Control.Concurrent.STM def :: [Command] -def = [noCommit $ noRepo startNoRepo $ dontCheck repoExists $ +def = [noCommit $ noRepo startNoRepo $ dontCheck repoExists $ notBareRepo $ command "webapp" paramNothing seek "launch webapp"] seek :: [CommandSeek] @@ -39,7 +39,7 @@ start :: CommandStart start = start' True start' :: Bool -> CommandStart -start' allowauto = notBareRepo $ do +start' allowauto = do liftIO $ ensureInstalled ifM isInitialized ( go , auto ) stop |