Skip to content

Commit

Permalink
make templates and commands directories as well as values.yaml option…
Browse files Browse the repository at this point in the history
…al (to enable override projects)
  • Loading branch information
s4ke committed Dec 29, 2022
1 parent f2c8c1d commit 3bb26c4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nothelm/lib/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,19 @@ def template_project(
This is so that we can merge multiple project folders into one
"""
default_values = load_values(f'{project_dir}/values.yaml')

if os.path.exists(f'{project_dir}/values.yaml'):
default_values = load_values(f'{project_dir}/values.yaml')
else:
default_values = dict()

values = merge_single(default_values, custom_values)

template_dir(project_dir + '/templates', target_dir + '/templates', all_files_as_template, strip_template_file_endings, values)
template_dir(project_dir + '/commands', target_dir + '/commands', all_files_as_template, strip_template_file_endings, values)
if os.path.exists(project_dir + '/templates'):
template_dir(project_dir + '/templates', target_dir + '/templates', all_files_as_template, strip_template_file_endings, values)

if os.path.exists(project_dir + '/commands'):
template_dir(project_dir + '/commands', target_dir + '/commands', all_files_as_template, strip_template_file_endings, values)


def template_dir(
Expand Down

0 comments on commit 3bb26c4

Please sign in to comment.