From 46fbb1a6151a0bb37ecbc99ff00344f8bbb531a8 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 20 Jul 2015 01:29:46 +0300 Subject: [PATCH] Have to type quit to quit --- yesod-bin/ChangeLog.md | 4 ++++ yesod-bin/Devel.hs | 10 +++++++++- yesod-bin/yesod-bin.cabal | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/yesod-bin/ChangeLog.md b/yesod-bin/ChangeLog.md index 79f44ca5..d43e450b 100644 --- a/yesod-bin/ChangeLog.md +++ b/yesod-bin/ChangeLog.md @@ -1,3 +1,7 @@ +## 1.4.12 + +* Devel server: have to type quit to quit + ## 1.4.11 * Add support to `yesod devel` to detect and use `GHC_PACKAGE_PATH`. This makes diff --git a/yesod-bin/Devel.hs b/yesod-bin/Devel.hs index d58acfe1..4acae1a7 100644 --- a/yesod-bin/Devel.hs +++ b/yesod-bin/Devel.hs @@ -238,10 +238,18 @@ devel opts passThroughArgs = withSocketsDo $ withManager $ \manager -> do let (terminator, after) = case terminateWith opts of TerminateOnEnter -> - ("Press ENTER", void getLine) + ("Type 'quit'", blockQuit) TerminateOnlyInterrupt -> -- run for one year ("Interrupt", threadDelay $ 1000 * 1000 * 60 * 60 * 24 * 365) + blockQuit = do + s <- getLine + if s == "quit" + then return () + else do + putStrLn "Type 'quit' to quit" + blockQuit + putStrLn $ "Yesod devel server. " ++ terminator ++ " to quit" void $ forkIO $ do diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index 8308cd39..57aab19e 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -1,5 +1,5 @@ name: yesod-bin -version: 1.4.11 +version: 1.4.12 license: MIT license-file: LICENSE author: Michael Snoyman