Ensure that files generated have a directory

pull/7501/head
Jimmy Brisson 2018-07-12 10:27:14 -05:00
parent c669655d86
commit 9a3ad69ee9
1 changed files with 2 additions and 0 deletions

View File

@ -9,6 +9,7 @@ from jinja2.environment import Environment
import copy
from tools.targets import TARGET_MAP
from tools.utils import mkdir
class TargetNotSupportedException(Exception):
@ -139,6 +140,7 @@ class Exporter(object):
"""Generates a project file from a template using jinja"""
target_text = self._gen_file_inner(template_file, data, target_file, **kwargs)
target_path = self.gen_file_dest(target_file)
mkdir(dirname(target_path))
logging.debug("Generating: %s", target_path)
open(target_path, "w").write(target_text)
self.generated_files += [target_path]