diff options
author | Kenneth Hsu <kennethhsu@gmail.com> | 2020-11-01 23:20:45 +0300 |
---|---|---|
committer | Kenneth Hsu <kennethhsu@gmail.com> | 2020-11-02 00:13:54 +0300 |
commit | 49e026ee92f3856a11bcbab8c62637ecf8263247 (patch) | |
tree | cc8a413a610eacbca3bd2225bfa599b6a6785f3a /Duplicati/Library | |
parent | b6e16189476648c7d260fb8ade9cc63599c9fa68 (diff) |
Fix issue where remote URL defined using run-script-before was ignored.
Previously, we were declaring that the m_remoteurl field be passed by
reference to the Execute method. However, the OnStart method declared
that the remoteurl variable was to be passed by reference. As a result,
the caller (Controller.SetupCommonOptions) method never received the
updated value.
Now, the variables being passed by reference are made consistent.
This fixes #3651.
Diffstat (limited to 'Duplicati/Library')
-rw-r--r-- | Duplicati/Library/Modules/Builtin/RunScript.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Duplicati/Library/Modules/Builtin/RunScript.cs b/Duplicati/Library/Modules/Builtin/RunScript.cs index be70ec078..e8188df22 100644 --- a/Duplicati/Library/Modules/Builtin/RunScript.cs +++ b/Duplicati/Library/Modules/Builtin/RunScript.cs @@ -153,16 +153,17 @@ namespace Duplicati.Library.Modules.Builtin public void OnStart(string operationname, ref string remoteurl, ref string[] localpath)
{
- m_operationName = operationname;
- m_remoteurl = remoteurl;
- m_localpath = localpath;
-
-
if (!string.IsNullOrEmpty(m_requiredScript))
- Execute(m_requiredScript, "BEFORE", m_operationName, ref m_remoteurl, ref m_localpath, m_timeout, true, m_options, null, null);
+ Execute(m_requiredScript, "BEFORE", operationname, ref remoteurl, ref localpath, m_timeout, true, m_options, null, null);
if (!string.IsNullOrEmpty(m_startScript))
- Execute(m_startScript, "BEFORE", m_operationName, ref m_remoteurl, ref m_localpath, m_timeout, false, m_options, null, null);
+ Execute(m_startScript, "BEFORE", operationname, ref remoteurl, ref localpath, m_timeout, false, m_options, null, null);
+
+ // Save options that might be set by a --run-script-before script so that the OnFinish method
+ // references the same values.
+ m_operationName = operationname;
+ m_remoteurl = remoteurl;
+ m_localpath = localpath;
}
public void OnFinish (object result)
|