From bcf1b59c1b1d0c09ca2c442d9909e07ae7c779fd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Feb 2015 16:34:42 -0400 Subject: [PATCH] webapp: Fix reversion in opening webapp when starting it manually inside a repository. --- Assistant/WebApp/DashBoard.hs | 2 +- Command/WebApp.hs | 11 ++++++++--- debian/changelog | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Assistant/WebApp/DashBoard.hs b/Assistant/WebApp/DashBoard.hs index f50a01aea1..5e5ea75b94 100644 --- a/Assistant/WebApp/DashBoard.hs +++ b/Assistant/WebApp/DashBoard.hs @@ -115,7 +115,7 @@ getFileBrowserR = whenM openFileBrowser redirectBack - blocking the response to the browser on it. -} openFileBrowser :: Handler Bool openFileBrowser = do - path <- liftAnnex $ fromRepo Git.repoPath + path <- liftIO . absPath =<< liftAnnex (fromRepo Git.repoPath) #ifdef darwin_HOST_OS let cmd = "open" let p = proc cmd [path] diff --git a/Command/WebApp.hs b/Command/WebApp.hs index 1c7bcfaa7f..46ba556a37 100644 --- a/Command/WebApp.hs +++ b/Command/WebApp.hs @@ -195,10 +195,15 @@ recordUrl _ = noop #endif openBrowser :: Maybe FilePath -> FilePath -> String -> Maybe Handle -> Maybe Handle -> IO () -#ifndef __ANDROID__ -openBrowser mcmd htmlshim _realurl outh errh = runbrowser -#else openBrowser mcmd htmlshim realurl outh errh = do + htmlshim' <- absPath htmlshim + openBrowser' mcmd htmlshim' realurl outh errh + +openBrowser' :: Maybe FilePath -> FilePath -> String -> Maybe Handle -> Maybe Handle -> IO () +#ifndef __ANDROID__ +openBrowser' mcmd htmlshim _realurl outh errh = runbrowser +#else +openBrowser' mcmd htmlshim realurl outh errh = do recordUrl url {- Android's `am` command does not work reliably across the - wide range of Android devices. Intead, FIFO should be set to diff --git a/debian/changelog b/debian/changelog index 643f872bf6..448475d7cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ git-annex (5.20150206) UNRELEASED; urgency=medium or --duplicate mode. * Windows: Fix bug in dropping an annexed file, which caused a symlink to be staged that contained backslashes. + * webapp: Fix reversion in opening webapp when starting it manually + inside a repository. -- Joey Hess Fri, 06 Feb 2015 13:57:08 -0400