mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-30 10:19:51 +08:00
draft:执行shell抽成task,并支持配置 (#1306)
* Shell抽象成为一个Task,并抽出Config * 代码格式化 * 格式化代码
This commit is contained in:
27
BetterGenshinImpact/GameTask/Shell/ShellTaskParam.cs
Normal file
27
BetterGenshinImpact/GameTask/Shell/ShellTaskParam.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using BetterGenshinImpact.Core.Config;
|
||||
using BetterGenshinImpact.GameTask.Model;
|
||||
|
||||
namespace BetterGenshinImpact.GameTask.Shell;
|
||||
|
||||
public class ShellTaskParam : BaseTaskParam
|
||||
{
|
||||
private ShellTaskParam(string command, int configTimeoutSeconds, bool configNoWindow, bool configOutput, bool configDisable)
|
||||
{
|
||||
Command = command;
|
||||
TimeoutSeconds = configTimeoutSeconds;
|
||||
NoWindow = configNoWindow;
|
||||
Output = configOutput;
|
||||
Disable = configDisable;
|
||||
}
|
||||
|
||||
public readonly bool Disable;
|
||||
public readonly string Command;
|
||||
public readonly int TimeoutSeconds;
|
||||
public readonly bool NoWindow;
|
||||
public readonly bool Output;
|
||||
|
||||
public static ShellTaskParam BuildFromConfig(string command, ShellConfig config)
|
||||
{
|
||||
return new ShellTaskParam(command, config.Timeout, config.NoWindow, config.Output, config.Disable);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user