summaryrefslogtreecommitdiffhomepage
path: root/Role
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-30 11:53:10 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-30 12:15:47 -0400
commit9331a37b178c9142f5e864bbdc5434ea208946cc (patch)
tree6431bc6cd3f09f8c64a51c780f7d549c3a6832ab /Role
parent5ddda2f7684857e90f45c37d030858773e96ee99 (diff)
downloaddebug-me-9331a37b178c9142f5e864bbdc5434ea208946cc.tar.gz
make url work without --debug
Diffstat (limited to 'Role')
-rw-r--r--Role/Developer.hs5
-rw-r--r--Role/User.hs4
2 files changed, 5 insertions, 4 deletions
diff --git a/Role/Developer.hs b/Role/Developer.hs
index 960a204..fc54c9f 100644
--- a/Role/Developer.hs
+++ b/Role/Developer.hs
@@ -35,14 +35,15 @@ import Data.Maybe
import Control.Monad
import Data.Monoid
import Data.Time.Clock.POSIX
+import Network.URI
run :: DeveloperOpts -> IO ()
run = run' developer . debugUrl
-run' :: (TMVar (TVar DeveloperState) -> TMChan (Message Entered) -> TMChan AnyMessage -> SessionID -> IO ()) -> UrlString -> IO ()
+run' :: (TMVar (TVar DeveloperState) -> TMChan (Message Entered) -> TMChan AnyMessage -> SessionID -> IO ()) -> URI -> IO ()
run' runner url = do
app <- do
- let connect = ConnectMode (T.pack url)
+ let connect = ConnectMode $ T.pack $ show url
dsv <- newEmptyTMVarIO
let recentactivity = developerStateRecentActivity dsv
return $ clientApp connect recentactivity Developer Just $
diff --git a/Role/User.hs b/Role/User.hs
index 0929f74..d11c235 100644
--- a/Role/User.hs
+++ b/Role/User.hs
@@ -42,7 +42,7 @@ run os = fromMaybe (ExitFailure 101) <$> connect
let url = sessionIDUrl sid "localhost" 8081
putStrLn ""
putStrLn "Others can connect to this session and help you debug by running:"
- putStrLn $ " debug-me --debug " ++ url
+ putStrLn $ " debug-me " ++ show url
hFlush stdout
withSessionLogger sid $ go ochan ichan usv controlinput controloutput
go ochan ichan usv controlinput controloutput logger = do
@@ -74,7 +74,7 @@ developerMessages (User _) = Nothing
shellCommand :: UserOpts -> IO (String, [String])
shellCommand os = case cmdToRun os of
- Just v -> return v
+ Just v -> return (v, [])
Nothing -> maybe ("bash", ["-l"]) (, []) <$> lookupEnv "SHELL"
-- | Log of recent Activity, with the most recent first.