Before #2580, we used to leave contributes untouched if no contributes were detected. Instead now, we always update contributes, removing files that are not detected by the function.
Detection of book mappings has always been broken on Windows. The path returned by Path.GetDirectoryName uses \ to separate paths, but the check for Books/Mapping checked with a forward slash.
I instead changed this function to properly detect the path Books/Mapping on any platform. As a result, the books should now properly be detected on Windows, and updating the mapping should always give the correct result.
Fix for #2636.
Before #2580, we used to leave contributes untouched if no contributes were detected. Instead now, we always update contributes, removing files that are not detected by the function.
Detection of book mappings has always been broken on Windows. The path returned by
Path.GetDirectoryName
uses\
to separate paths, but the check for Books/Mapping checked with a forward slash.I instead changed this function to properly detect the path Books/Mapping on any platform. As a result, the books should now properly be detected on Windows, and updating the mapping should always give the correct result.