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
cwd <- liftIO getCurrentDirectory
home <- myHomeDir
#ifndef mingw32_HOST_OS
if home == cwd && firstrun
then inhome
else ifM (legit cwd <&&> canWrite cwd)
( return cwd
, inhome
)
#else
-- Windows user can probably write anywhere, so always default
-- to ~/Desktop/annex.
inhome
#endif
where
inhome = do
desktop <- userDesktopDir