Commit 464fab49 authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

normalize env variables

parent 874ff5c7
......@@ -303,8 +303,8 @@ def add_attribute_to_links (src, attrname, attrvalue):
def template_action (target, source, env):
tpath, tname = os.path.split(env.Dictionary().get("index_template"))
rootpath = env.Dictionary().get("rootpath")
tpath, tname = os.path.split(env.Dictionary().get("SCONS_TEMPLATE"))
rootpath = os.path.abspath(env.Dictionary().get("SCONS_ROOT"))
jenv = jinja2.Environment(loader=jinja2.FileSystemLoader(tpath))
......@@ -352,7 +352,7 @@ def template_action (target, source, env):
print (template.render(**data), file=fout)
# Template = Builder(action=template_action)
Template = Builder(action=Action(template_action, varlist=("index_template", "rootpath")))
Template = Builder(action=Action(template_action, varlist=("SCONS_TEMPLATE", "SCONS_ROOT")))
### Perform the build
builders = {
......@@ -519,12 +519,10 @@ for folder, deps in depwalk("."):
depsmeta.append(file_meta)
env.FolderMeta(target=folder_meta_path, source=deps+depsmeta)
template_path = os.environ.get("scons-template") or "templates/index.html"
root_path = os.environ.get("scons-root") or rootdir.abspath
env.Template(target=os.path.join(folder, "index.html"), \
source=[folder_meta_path, File(template_path)], \
index_template=template_path, \
rootpath=rootdir.abspath)
SCONS_TEMPLATE=os.environ.get("SCONS_TEMPLATE") or "templates/index.html", \
SCONS_ROOT=os.environ.get("SCONS_ROOT") or rootdir.abspath
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment