Handle relative paths in symlinks

Fixes #639
This commit is contained in:
Dougal Matthews
2016-02-17 21:46:54 +00:00
committed by Dougal Matthews
parent e9fb2d5e42
commit 6619010702
2 changed files with 3 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ You can determine your currently installed version using `mkdocs --version`:
## Version 0.15.3 (2016-02-??)
* Improve the error message the given theme can't be found.
* Fix an issue with relative symlinks (#639)
## Version 0.15.2 (2016-02-08)

View File

@@ -352,7 +352,8 @@ class Extras(OptionallyRequired):
# Some editors (namely Emacs) will create temporary symlinks
# for internal magic. We can just ignore these files.
if os.path.islink(fullpath):
if not os.path.exists(os.readlink(fullpath)):
fp = os.path.join(dirpath, os.readlink(fullpath))
if not os.path.exists(fp):
continue
relpath = os.path.normpath(os.path.relpath(fullpath, docs_dir))