diff --git a/Assistant/WebApp/Configurators/Local.hs b/Assistant/WebApp/Configurators/Local.hs index 6540b8a986..9bfb2e7f96 100644 --- a/Assistant/WebApp/Configurators/Local.hs +++ b/Assistant/WebApp/Configurators/Local.hs @@ -351,15 +351,12 @@ driveList :: IO [RemovableDrive] #ifdef mingw32_HOST_OS -- Just enumerate all likely drive letters for Windows. -- Could use wmic, but it only works for administrators. -driveList = return $ map (:":") ['A'..'Z'] +driveList = return $ map (\l -> gen $ l:":") ['A'..'Z'] + where #else #ifdef WITH_CLIBS driveList = mapM (gen . mnt_dir) =<< filter sane <$> getMounts where - gen dir = RemovableDrive - <$> getDiskFree dir - <*> pure (T.pack dir) - <*> pure (T.pack gitAnnexAssistantDefaultDir) -- filter out some things that are surely not removable drives sane Mntent { mnt_dir = dir, mnt_fsname = dev } {- We want real disks like /dev/foo, not @@ -379,8 +376,13 @@ driveList = mapM (gen . mnt_dir) =<< filter sane <$> getMounts | otherwise = True #else driveList = return [] + where #endif #endif + gen dir = RemovableDrive + <$> getDiskFree dir + <*> pure (T.pack dir) + <*> pure (T.pack gitAnnexAssistantDefaultDir) {- Bootstraps from first run mode to a fully running assistant in a - repository, by running the postFirstRun callback, which returns the