feat: initial project commit
All checks were successful
default / default (8.0) (push) Successful in 39s

This commit is contained in:
Louis Seubert 2024-04-27 20:15:05 +02:00
commit 833bc2bd9c
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD
52 changed files with 3783 additions and 0 deletions

View 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");
}
}
}