JD2022-TU1/main/tools/apps/TeaBox/Script/Build/Code/NugetRestoreCommand.cs

37 lines
No EOL
923 B
C#

using System.Text;
using TeaBox.Core.Helpers;
namespace TeaBox.Code
{
public class NugetRestoreCommand : ProcessTask
{
protected override string CommandName => LocatorService.LocateApplicationFromScripts("nuget.exe");
private string[] Arguments { get; }
private string SolutionPath { get; }
public NugetRestoreCommand(string solutionPath, params string[] args)
{
SolutionPath = solutionPath;
Arguments = args;
}
protected override string GetArguments()
{
var builder = new StringBuilder($"restore {SolutionPath} ");
foreach (var arg in Arguments)
{
builder.Append($"-{arg} ");
}
return builder.ToString();
}
protected override bool IsSuccessfulExitCode(int exitCode)
{
return true;
}
}
}