webapp: Fix bug setting up ssh repo if the user enters "~/" at the start of the path.

This commit is contained in:
Joey Hess 2013-06-25 15:43:46 -04:00
parent c8e6947693
commit f1fe8edbbb
3 changed files with 8 additions and 0 deletions

View file

@ -49,6 +49,7 @@ makeSshRemote forcersync sshdata mcost = do
h = sshHostName sshdata
d
| T.pack "/" `T.isPrefixOf` sshDirectory sshdata = sshDirectory sshdata
| T.pack "~/" `T.isPrefixOf` sshDirectory sshdata = T.concat [T.pack "/", sshDirectory sshdata]
| otherwise = T.concat [T.pack "/~/", sshDirectory sshdata]
{- Runs an action that returns a name of the remote, and finishes adding it. -}