Skip to content

Commit bf0e4ba

Browse files
committed
fix Executable plugin's JsonRPC request string
This is a fix of Executable plugin's JsonRPC request string for ProcessStartInfo, but tested and should be used specifically for Typescript + JavaScript plugin
1 parent a53760b commit bf0e4ba

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Flow.Launcher.Core/Plugin/ExecutablePlugin.cs

Lines changed: 8 additions & 4 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,17 +21,22 @@ 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
}

0 commit comments

Comments
 (0)