From 49d512b3f18db3370554c0e5b57b2dfc5d1d2abd Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Sat, 16 Dec 2023 16:08:28 -0500 Subject: [PATCH] fix: Make containerfile formatting nicer --- templates/Containerfile.modules | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/templates/Containerfile.modules b/templates/Containerfile.modules index 0bb3d62..189e185 100644 --- a/templates/Containerfile.modules +++ b/templates/Containerfile.modules @@ -27,26 +27,26 @@ ARG CONFIG_DIRECTORY="/tmp/config" ARG IMAGE_NAME="{{ name }}" ARG BASE_IMAGE="{{ base_image }}" -{% macro run_modules(module) %} -{% if module.type %} - {% if module.type == "containerfile" %} - {% for c in module.containerfiles %} +{%- macro run_modules(module) %} + {%- if module.type %} + {%- if module.type == "containerfile" %} + {%- for c in module.containerfiles %} {{ print_containerfile(containerfile = c ) }} - {% endfor %} - {% else %} + {%- endfor %} + {%- else %} RUN chmod +x /tmp/modules/{{ module.type }}/{{ module.type }}.sh RUN source /tmp/exports.sh && OS_VERSION="$(grep -Po '(?<=VERSION_ID=)\d+' /usr/lib/os-release)" /tmp/modules/{{ module.type }}/{{ module.type }}.sh '{{ print_module_context(module = module) }}' - {% endif %} -{% elif module["from-file"] %} -{% set extra_module = get_module_from_file(file = module["from-file"]) %} -{% for m in extra_module.modules %} + {%- endif %} + {%- elif module["from-file"] %} + {%- set extra_module = get_module_from_file(file = module["from-file"]) %} + {%- for m in extra_module.modules %} {{ self::run_modules(module = m) }} -{% endfor %} -{% endif %} -{% endmacro run_modules %} + {%- endfor %} + {%- endif %} +{%- endmacro run_modules %} -{% for module in modules %} +{%- for module in modules %} {{ self::run_modules(module = module) }} -{% endfor %} +{%- endfor %} RUN rm -rf /tmp/* /var/* && ostree container commit