better default annex location on windows

This commit is contained in:
Joey Hess 2013-12-09 16:39:23 -04:00
parent fc3a9a8adb
commit 51b43f2b68

View file

@ -116,12 +116,18 @@ defaultRepositoryPath :: Bool -> IO FilePath
defaultRepositoryPath firstrun = do defaultRepositoryPath firstrun = do
cwd <- liftIO getCurrentDirectory cwd <- liftIO getCurrentDirectory
home <- myHomeDir home <- myHomeDir
#ifndef mingw32_HOST_OS
if home == cwd && firstrun if home == cwd && firstrun
then inhome then inhome
else ifM (legit cwd <&&> canWrite cwd) else ifM (legit cwd <&&> canWrite cwd)
( return cwd ( return cwd
, inhome , inhome
) )
#else
-- Windows user can probably write anywhere, so always default
-- to ~/Desktop/annex.
inhome
#endif
where where
inhome = do inhome = do
desktop <- userDesktopDir desktop <- userDesktopDir