We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ef397e commit 46968b0Copy full SHA for 46968b0
scripts/generators/asciidoc_fields.py
@@ -141,8 +141,14 @@ def save_asciidoc(f, text):
141
# jinja2 setup
142
143
144
+cur_dir = path.abspath(path.curdir)
145
local_dir = path.dirname(path.abspath(__file__))
-TEMPLATE_DIR = path.join(local_dir, '../templates')
146
+CUR_TEMPLATE_DIR = path.join(cur_dir, 'templates')
147
+LOCAL_TEMPLATE_DIR = path.join(local_dir, '../templates')
148
+if path.exists(CUR_TEMPLATE_DIR):
149
+ TEMPLATE_DIR = CUR_TEMPLATE_DIR
150
+elif path.exists(LOCAL_TEMPLATE_DIR):
151
+ TEMPLATE_DIR = LOCAL_TEMPLATE_DIR
152
template_loader = jinja2.FileSystemLoader(searchpath=TEMPLATE_DIR)
153
template_env = jinja2.Environment(loader=template_loader, keep_trailing_newline=True)
154
0 commit comments