From ba8dddc7fec6a892dd7d55379db58b4bbedf6e9d Mon Sep 17 00:00:00 2001 From: Brian Lakstins Date: Fri, 12 Jan 2018 09:43:07 -0500 Subject: [PATCH] Move RunScript module to be configured first so that any configuration changes can be used by other modules --- Duplicati/Library/Main/Controller.cs | 12 ++++++++++++ .../Library/Modules/Builtin/run-script-example.bat | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Duplicati/Library/Main/Controller.cs b/Duplicati/Library/Main/Controller.cs index e89cc3f3c..bcfb8d342 100644 --- a/Duplicati/Library/Main/Controller.cs +++ b/Duplicati/Library/Main/Controller.cs @@ -771,7 +771,19 @@ namespace Duplicati.Library.Main foreach (var k in qp.Keys) conopts[(string)k] = qp[(string)k]; + //// Since Configure in RunScript can alter the RawOptions, make sure it is first in the list for Configure + var LoadedModules = new List>(); foreach (var mx in m_options.LoadedModules) + if (mx.Value.ToString().ToLower().Contains("runscript")) + { + LoadedModules.Insert(0, mx); + } + else + { + LoadedModules.Add(mx); + } + + foreach (var mx in LoadedModules) if (mx.Key) { if (mx.Value is Library.Interface.IConnectionModule) diff --git a/Duplicati/Library/Modules/Builtin/run-script-example.bat b/Duplicati/Library/Modules/Builtin/run-script-example.bat index b6ecdb00a..123c1bbe9 100644 --- a/Duplicati/Library/Modules/Builtin/run-script-example.bat +++ b/Duplicati/Library/Modules/Builtin/run-script-example.bat @@ -52,7 +52,7 @@ REM All Duplicati options can be changed by the script by writing options to REM stdout (with echo or similar). Anything not starting with a double dash (--) REM will be ignored: REM echo "Hello! -- test, this line is ignored" -REM echo "--new-option=""This will be a setting""" +REM echo --new-option=This will be a setting REM Filters are supplied in the DUPLICAT__FILTER variable. REM The variable contains all filters supplied with --include and --exclude,