feat: initial project commit
All checks were successful
default / default (8.0) (push) Successful in 39s
All checks were successful
default / default (8.0) (push) Successful in 39s
This commit is contained in:
commit
833bc2bd9c
52 changed files with 3783 additions and 0 deletions
36
src/Process.Tests.Dummy/Program.cs
Normal file
36
src/Process.Tests.Dummy/Program.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Geekeey.Extensions.Process.Tests.Dummy.Commands;
|
||||
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Geekeey.Extensions.Process.Tests.Dummy;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
private static readonly string? FileExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "exe" : null;
|
||||
|
||||
#pragma warning disable IL3000 // only for testing where we don't run in single files!
|
||||
private static readonly string AssemblyPath = Assembly.GetExecutingAssembly().Location;
|
||||
#pragma warning restore IL3000
|
||||
|
||||
public static string FilePath { get; } = Path.ChangeExtension(AssemblyPath, FileExtension);
|
||||
|
||||
private static Task<int> Main(string[] args)
|
||||
{
|
||||
Environment.SetEnvironmentVariable("DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION", "false");
|
||||
var app = new CommandApp();
|
||||
app.Configure(Configuration);
|
||||
return app.RunAsync(args);
|
||||
|
||||
void Configuration(IConfigurator configuration)
|
||||
{
|
||||
configuration.AddCommand<EchoCommand>("echo");
|
||||
configuration.AddCommand<EchoStdinCommand>("echo-stdin");
|
||||
configuration.AddCommand<EnvironmentCommand>("env");
|
||||
configuration.AddCommand<WorkingDirectoryCommand>("cwd");
|
||||
configuration.AddCommand<ExitCommand>("exit");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue