@@ -29,7 +29,8 @@ import Data.Reflection (Given)
29
29
import Fmt (Buildable (.. ), nameF , (+|) , (|+) )
30
30
import System.Directory (doesDirectoryExist )
31
31
import System.Directory.Tree qualified as Tree
32
- import System.FilePath (dropTrailingPathSeparator , equalFilePath , takeDirectory , takeExtension )
32
+ import qualified System.FilePath as OsDependentFilePath
33
+ import System.FilePath.Posix (dropTrailingPathSeparator , equalFilePath , takeDirectory , takeExtension )
33
34
34
35
import Xrefcheck.Core
35
36
import Xrefcheck.Progress
@@ -100,15 +101,17 @@ scanRepo rw formatsSupport config root = do
100
101
101
102
_ Tree. :/ repoTree <- liftIO $ Tree. readDirectoryWithL processFile root
102
103
let (errs, fileInfos) = gatherScanErrs &&& gatherFileInfos
103
- $ dropSndMaybes . F. toList
104
+ $ map (first useLinuxPathSep) . dropSndMaybes . F. toList
104
105
$ Tree. zipPaths $ location Tree. :/ repoTree
105
106
return . ScanResult errs $ RepoInfo (M. fromList fileInfos)
106
107
where
107
108
isDirectory = readingSystem . doesDirectoryExist
108
109
gatherScanErrs = foldMap (snd . snd )
109
110
gatherFileInfos = map (bimap normaliseWithNoTrailing fst )
111
+ useLinuxPathSep | OsDependentFilePath. pathSeparator == ' /' = id
112
+ | otherwise = intercalate " /" . OsDependentFilePath. splitDirectories
110
113
111
- processFile file = do
114
+ processFile (useLinuxPathSep -> file) = do
112
115
let ext = takeExtension file
113
116
let mscanner = formatsSupport ext
114
117
if isIgnored file
0 commit comments