summaryrefslogtreecommitdiffhomepage
path: root/ControlWindow.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-05-05 14:27:39 -0400
committerJoey Hess <joeyh@joeyh.name>2017-05-05 14:30:46 -0400
commit2f5315b3c32fbd23ebce05da80712183dc259b7c (patch)
tree48de39738910859cb0eaaf15cbfe9529b44e4272 /ControlWindow.hs
parent4a2a01a7eaa8945d063468d7d1c24f095a3ae2a4 (diff)
downloaddebug-me-2f5315b3c32fbd23ebce05da80712183dc259b7c.tar.gz
standalone tarball
Adapted the standalone tarball building code from git-annex.
Diffstat (limited to 'ControlWindow.hs')
-rw-r--r--ControlWindow.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/ControlWindow.hs b/ControlWindow.hs
index 4f806c9..c5a6be9 100644
--- a/ControlWindow.hs
+++ b/ControlWindow.hs
@@ -67,7 +67,7 @@ openControlWindow = do
ichan <- newTMChanIO
ochan <- newTMChanIO
_ <- async $ serveControlSocket soc ichan ochan
- myexe <- getExecutablePath
+ myexe <- getMyExe
mproc <- runInVirtualTerminal winDesc myexe ["--control"]
let cannotrun = do
putStrLn "You need to open another shell prompt, and run: debug-me --control"
@@ -83,6 +83,13 @@ openControlWindow = do
Left (Just ControlWindowOpened) -> return (ichan, ochan)
Left _ -> error "unexpected message from control process"
Right _ -> cannotrun
+
+
+-- | Get path to debug-me program.
+--
+-- The standalone bundle sets DEBUG_ME_EXE to the path to use.
+getMyExe :: IO FilePath
+getMyExe = maybe getExecutablePath return =<< lookupEnv "DEBUG_ME_EXE"
type Prompt = ()
type Response = String