summaryrefslogtreecommitdiffhomepage
path: root/Session.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-25 00:21:44 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-25 00:21:44 -0400
commita835e9e4b410d98bcae0c0f5be485e6daac407d4 (patch)
tree86a414b3e8bc767c265da44a0f1ea5cd6b62ec4d /Session.hs
parent17d76b2a59d496a2ffd6d2199b1c6ad563b0bb5b (diff)
downloaddebug-me-a835e9e4b410d98bcae0c0f5be485e6daac407d4.tar.gz
include "session is done" in the session transcript
Including the process exit status. And cleaner Role.User shutdown sequence.
Diffstat (limited to 'Session.hs')
-rw-r--r--Session.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Session.hs b/Session.hs
index 5840cee..a80cad5 100644
--- a/Session.hs
+++ b/Session.hs
@@ -3,11 +3,16 @@
module Session where
import qualified Data.ByteString as B
+import qualified Data.ByteString.Char8 as B8
+import System.Exit
+import Data.Monoid
startSession :: B.ByteString
startSession = ">>> debug-me session started"
-sessionDone :: IO ()
-sessionDone = do
- putStrLn ""
- putStrLn ">>> debug-me session ended"
+endSession :: ExitCode -> B.ByteString
+endSession ec = ">>> debug-me session ended (" <> B8.pack (show n) <> ")"
+ where
+ n = case ec of
+ ExitSuccess -> 0
+ ExitFailure c -> c