Skip to content

Commit 73461bb

Browse files
authored
Merge pull request #927 from Flow-Launcher/fix_typescript_plugin_request
Fix typescript plugin request
2 parents b70d198 + bf0e4ba commit 73461bb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Flow.Launcher.Core/Plugin/ExecutablePlugin.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Diagnostics;
1+
using System.Diagnostics;
32
using System.IO;
43
using System.Threading;
54
using System.Threading.Tasks;
@@ -22,18 +21,23 @@ public ExecutablePlugin(string filename)
2221
RedirectStandardOutput = true,
2322
RedirectStandardError = true
2423
};
24+
25+
// required initialisation for below request calls
26+
_startInfo.ArgumentList.Add(string.Empty);
2527
}
2628

2729
protected override Task<Stream> RequestAsync(JsonRPCRequestModel request, CancellationToken token = default)
2830
{
29-
_startInfo.Arguments = $"\"{request}\"";
31+
// since this is not static, request strings will build up in ArgumentList if index is not specified
32+
_startInfo.ArgumentList[0] = request.ToString();
3033
return ExecuteAsync(_startInfo, token);
3134
}
3235

3336
protected override string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default)
3437
{
35-
_startInfo.Arguments = $"\"{rpcRequest}\"";
38+
// since this is not static, request strings will build up in ArgumentList if index is not specified
39+
_startInfo.ArgumentList[0] = rpcRequest.ToString();
3640
return Execute(_startInfo);
3741
}
3842
}
39-
}
43+
}

0 commit comments

Comments
 (0)