summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-07-07 22:00:44 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-07-07 22:00:44 +0200
commit486c73b43ab4137f1a17ada1f1a69e5e81e2901d (patch)
tree32b208c22af2fc8d169ecfebe99d9f8a8fae665c
parente579708549ab1e3dd658eb2491c05dff098f0de1 (diff)
downloadqutebrowser-486c73b43ab4137f1a17ada1f1a69e5e81e2901d.tar.gz
qutebrowser-486c73b43ab4137f1a17ada1f1a69e5e81e2901d.zip
scripts: Make asciidoc2html.py --web work outside the repository
See #5559
-rwxr-xr-xscripts/asciidoc2html.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index b15356540..7e5e20d68 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -121,7 +121,7 @@ class AsciiDoc:
src = root / filename
assert self._website is not None # for mypy
dst = pathlib.Path(self._website)
- dst = dst / src.parent.relative_to('.') / (src.stem + ".html")
+ dst = dst / src.parent.relative_to(REPO_ROOT) / (src.stem + ".html")
dst.parent.mkdir(exist_ok=True)
assert self._tempdir is not None # for mypy
@@ -189,7 +189,7 @@ class AsciiDoc:
assert self._website is not None # for mypy
outdir = pathlib.Path(self._website)
- for item_path in pathlib.Path().rglob('*.asciidoc'):
+ for item_path in pathlib.Path(REPO_ROOT).rglob('*.asciidoc'):
if item_path.stem in ['header', 'OpenSans-License']:
continue
self._build_website_file(item_path.parent, item_path.name)
@@ -197,12 +197,13 @@ class AsciiDoc:
copy = {'icons': 'icons', 'doc/img': 'doc/img', 'www/media': 'media/'}
for src, dest in copy.items():
+ full_src = REPO_ROOT / src
full_dest = outdir / dest
try:
shutil.rmtree(full_dest)
except FileNotFoundError:
pass
- shutil.copytree(src, full_dest)
+ shutil.copytree(full_src, full_dest)
for dst, link_name in [
('README.html', 'index.html'),