From 2f4c0c1b56e2521911675aa171bf331d7bab0d15 Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Mon, 8 Apr 2024 15:28:38 +0200 Subject: [PATCH] Fixed pre-init script order (#1348) ## Changes `preinit` script needs to be executed before processing configuration files to allow the script to modify the configuration or add own configuration files. --- bundle/config/mutator/mutator.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bundle/config/mutator/mutator.go b/bundle/config/mutator/mutator.go index fda11827..9a2c828b 100644 --- a/bundle/config/mutator/mutator.go +++ b/bundle/config/mutator/mutator.go @@ -9,14 +9,17 @@ import ( func DefaultMutators() []bundle.Mutator { return []bundle.Mutator{ + // Execute preinit script before loading any configuration files. + // It needs to be done before processing configuration files to allow + // the script to modify the configuration or add own configuration files. + scripts.Execute(config.ScriptPreInit), + loader.EntryPoint(), loader.ProcessRootIncludes(), // Verify that the CLI version is within the specified range. VerifyCliVersion(), - // Execute preinit script after loading all configuration files. - scripts.Execute(config.ScriptPreInit), EnvironmentsToTargets(), InitializeVariables(), DefineDefaultTarget(),