Skip to content

Commit 0a8323b

Browse files
committed
enhance: supports to use $REPO in Default field of TextBox/PathSelector in custom actions (#1466)
Signed-off-by: leo <[email protected]>
1 parent b31495b commit 0a8323b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ViewModels/ExecuteCustomAction.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ public override Task<bool> Sure()
126126
_repo.SetWatcherEnabled(false);
127127
ProgressDescription = "Run custom action ...";
128128

129-
var cmdline = CustomAction.Arguments.Replace("${REPO}", GetWorkdir());
130-
cmdline = PrepareStringByTarget(cmdline);
131-
129+
var cmdline = PrepareStringByTarget(CustomAction.Arguments);
132130
for (var i = ControlParameters.Count - 1; i >= 0; i--)
133131
{
134132
var param = ControlParameters[i];
@@ -174,6 +172,8 @@ private void PrepareControlParameters()
174172

175173
private string PrepareStringByTarget(string org)
176174
{
175+
org = org.Replace("${REPO}", GetWorkdir());
176+
177177
if (Target is Models.Branch b)
178178
return org.Replace("${BRANCH}", b.FriendlyName);
179179
else if (Target is Models.Commit c)

0 commit comments

Comments
 (0)