Commit 242d1f5c authored by Ryan Pavlik's avatar Ryan Pavlik

Search cwd and up for boilerplate data

parent 8af64bf7
......@@ -12,6 +12,7 @@
import argparse
import file_boilerplate.filters
from file_boilerplate.find_paths import find_paths
from jinja2 import Environment, FileSystemLoader
from jinja2.utils import Markup
from uuid import uuid4
......@@ -19,8 +20,8 @@ from re import sub
from sys import exit
import subprocess
from datetime import date
from os import getcwd
from os.path import exists
def make_guid_include_guard(fn):
guid = str(uuid4()).upper().replace('-','_')
raw_include_guard = "INCLUDED_{fn}_GUID_{guid}".format(fn=fn, guid=guid)
......@@ -35,8 +36,9 @@ def make_year():
return date.today().year
def do_make_guid():
return str(uuid4()).upper()
def make_environment():
env = Environment(keep_trailing_newline=True, autoescape=False, loader=FileSystemLoader([getcwd() + '/.boilerplate']))
env = Environment(keep_trailing_newline=True, autoescape=False, loader=FileSystemLoader(find_paths()))
env.globals['year'] = make_year()
env.globals['author'] = make_author()
env.filters['prefix_block'] = file_boilerplate.filters.do_prefix_block
......
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