Windows: Fix opening file browser from webapp when repo is in a directory with spaces.

This commit is contained in:
Joey Hess 2014-06-17 14:18:15 -04:00
parent 5977e161f3
commit 8f98d28da4
2 changed files with 8 additions and 4 deletions

View file

@ -118,20 +118,22 @@ openFileBrowser = do
path <- liftAnnex $ fromRepo Git.repoPath path <- liftAnnex $ fromRepo Git.repoPath
#ifdef darwin_HOST_OS #ifdef darwin_HOST_OS
let cmd = "open" let cmd = "open"
let params = [Param path] let p = proc cmd [path]
#else #else
#ifdef mingw32_HOST_OS #ifdef mingw32_HOST_OS
{- Changing to the directory and then opening . works around
- spaces in directory name, etc. -}
let cmd = "cmd" let cmd = "cmd"
let params = [Param $ "/c start " ++ path] let p = (proc cmd ["/c start ."]) { cwd = Just path }
#else #else
let cmd = "xdg-open" let cmd = "xdg-open"
let params = [Param path] let p = proc cmd [path]
#endif #endif
#endif #endif
ifM (liftIO $ inPath cmd) ifM (liftIO $ inPath cmd)
( do ( do
let run = void $ liftIO $ forkIO $ void $ let run = void $ liftIO $ forkIO $ void $
boolSystem cmd params createProcess p
run run
#ifdef mingw32_HOST_OS #ifdef mingw32_HOST_OS
{- On windows, if the file browser is not {- On windows, if the file browser is not

2
debian/changelog vendored
View file

@ -4,6 +4,8 @@ git-annex (5.20140614) UNRELEASED; urgency=medium
* Windows: Got rid of that pesky DOS box when starting the webapp. * Windows: Got rid of that pesky DOS box when starting the webapp.
* Windows: Added Startup menu item so assistant starts automatically * Windows: Added Startup menu item so assistant starts automatically
on login. on login.
* Windows: Fix opening file browser from webapp when repo is in a
directory with spaces.
-- Joey Hess <joeyh@debian.org> Mon, 16 Jun 2014 11:28:42 -0400 -- Joey Hess <joeyh@debian.org> Mon, 16 Jun 2014 11:28:42 -0400