From 0c263ec4ee4ff16a59655490fd18bad4c152de07 Mon Sep 17 00:00:00 2001 From: Jeff Wong Date: Mon, 5 Apr 2021 06:13:53 -1000 Subject: [PATCH] Reverse the order of nested templates. (#531) Reverses the order of nested template declaration. This way templates that depend nested templates over the same hook are ensured to run in the proper order. Ensures consistency of run-order template includes, for both base yml files, and nested template yml eg: base.yml ``` templates: - "templates/template1.yml" hooks: after_code: - exec: cat "/tmp/file_made_from_template1.yml.txt" ``` template1.yml ``` templates: - "templates/template2.yml" hooks: after_code: - exec: cat "/tmp/file_made_from_template2.yml.txt" - exec: echo "data from template1" > /tmp/file_made_from_template1.yml.txt ``` template2.yml ``` hooks: after_code: - exec: echo "data from template2" > /tmp/file_made_from_template2.yml.txt ``` --- launcher | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher b/launcher index d5a6e4c..173a1d6 100755 --- a/launcher +++ b/launcher @@ -280,7 +280,7 @@ find_templates() { local nested_templates=$(find_templates $template) if [ ! -z "$nested_templates" ]; then - templates="$templates $nested_templates" + templates="$nested_templates $templates" fi done -- 2.25.1