We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a15d6d3 commit b85bccaCopy full SHA for b85bcca
1 file changed
src/StaticLS/FilePath.hs
@@ -42,7 +42,9 @@ subRootExtensionFilepathUnchecked removeParents addParent extension targetPath =
42
let
43
-- Normalize to absolute paths to drop the prefix
44
noPrefixSrcPath =
45
- List.foldl' (\path parent -> Path.makeRelative parent path) targetPath removeParents
+ case filter (\parent -> parent.path `List.isPrefixOf` targetPath.path) removeParents of
46
+ (parent:_) -> Path.makeRelative parent targetPath
47
+ [] -> targetPath
48
-- Set the directory path and substitute the file extension
49
newPath = addParent Path.</> noPrefixSrcPath Path.-<.> extension
50
in
0 commit comments