From 1d8a8b57c7b37ee91d7dcecdfa5ed7dada465067 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 6 Dec 2014 17:32:04 +0100 Subject: [PATCH] Fix asciidoc2html with --all --- scripts/asciidoc2html.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index f9c731943..1aa1f7abe 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -78,7 +78,14 @@ def main(colors=False): pass if args.all: for src in glob.glob('**/*.asciidoc') + glob.glob('*.asciidoc'): - dst = os.path.join(args.all[0], os.path.relpath(src)) + parts = [args.all[0]] + dirname = os.path.dirname(src) + if dirname: + parts.append(os.path.relpath(os.path.dirname(src))) + parts.append( + os.extsep.join((os.path.splitext(os.path.basename(src))[0], + 'html'))) + dst = os.path.join(*parts) os.makedirs(os.path.dirname(dst), exist_ok=True) call_asciidoc(src, dst) else: