Browse Source

Merge pull request #19 from foosel/fix/18

Fix file_exists helper under Windows
Jan Holthuis 4 years ago
parent
commit
30415b0fcf
1 changed files with 5 additions and 0 deletions
  1. 5 0
      sphinx_multiversion/git.py

+ 5 - 0
sphinx_multiversion/git.py

@@ -2,6 +2,7 @@
 import collections
 import datetime
 import logging
+import os
 import re
 import subprocess
 import tarfile
@@ -119,6 +120,10 @@ def get_refs(
 
 
 def file_exists(gitroot, refname, filename):
+    if os.sep != "/":
+        # Git requires / path sep, make sure we use that
+        filename = filename.replace(os.sep, "/")
+
     cmd = (
         "git",
         "cat-file",