2023-11-04 02:16:51 +00:00
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.IO.Pipelines;
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Flow.Launcher.Plugin;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Flow.Launcher.Core.Plugin
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Execution of JavaScript & TypeScript plugins
|
|
|
|
|
|
/// </summary>
|
2024-02-16 04:06:19 +00:00
|
|
|
|
internal sealed class NodePluginV2 : ProcessStreamPluginV2
|
2023-11-04 02:16:51 +00:00
|
|
|
|
{
|
|
|
|
|
|
public NodePluginV2(string filename)
|
|
|
|
|
|
{
|
2024-02-16 04:06:19 +00:00
|
|
|
|
StartInfo = new ProcessStartInfo { FileName = filename, };
|
2023-11-04 02:16:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override ProcessStartInfo StartInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public override async Task InitAsync(PluginInitContext context)
|
|
|
|
|
|
{
|
|
|
|
|
|
StartInfo.ArgumentList.Add(context.CurrentPluginMetadata.ExecuteFilePath);
|
|
|
|
|
|
await base.InitAsync(context);
|
|
|
|
|
|
}
|
2024-02-19 05:46:24 +00:00
|
|
|
|
|
|
|
|
|
|
protected override MessageHandlerType MessageHandler { get; } = MessageHandlerType.HeaderDelimited;
|
2023-11-04 02:16:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|