From ebc82178128bf4a2d4fadc046d0bdbaaf3fc2ab1 Mon Sep 17 00:00:00 2001 From: Gerard Braad Date: Sat, 20 Feb 2021 18:12:04 +0800 Subject: [PATCH 1/2] Allow override of default distro Signed-off-by: Gerard Braad --- Program.cs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Program.cs b/Program.cs index 25e5ebf..f094179 100644 --- a/Program.cs +++ b/Program.cs @@ -100,6 +100,15 @@ private static string Shell } } + private static string Distro + { + get + { + string distro = Configuration["distro"]; + return (distro != null) ? distro : String.Empty; + } + } + private static void PrintHelp () { ConsoleColor oldColor = Console.ForegroundColor; @@ -130,15 +139,13 @@ private static int Main (string[] args) try { - string shell = Program.Shell; + // Set chosen distro and shell + string distro = (Program.Distro == String.Empty) ? String.Empty : "-d {Program.Distro}"; + string arguments = $"{distro} genie -c {Program.Shell}"; Process ps; - if(args.Length == 0) { - // No arguments given - ps = Process.Start (fileName: "wsl", - arguments: $"-e genie -c {shell}"); - } else { - // Check through arguments, one by one. + if(args.Length > 0) { + // Check through additional arguments, one by one. var param = new List (); foreach (var arg in args) @@ -147,11 +154,10 @@ private static int Main (string[] args) param.Add (item: Program.IsWindowsPath (arg: arg) ? Program.TranslatePath (path: arg) : arg); // Execute in WSL. - ps = Process.Start (fileName: "wsl", - arguments: $"-e genie -c {shell} -c \"{string.Join (separator: ' ', values: param)}\""); + arguments = $"{arguments} -c \"{string.Join (separator: ' ', values: param)}\""; } - + ps = Process.Start (fileName: "wsl", arguments: arguments); ps.WaitForExit (); return ps.ExitCode; From baab4a000e1b360daee0331ca4ed649c139781f7 Mon Sep 17 00:00:00 2001 From: Gerard Braad Date: Sat, 20 Feb 2021 18:13:49 +0800 Subject: [PATCH 2/2] Remove erroneous subdirectory in copy Signed-off-by: Gerard Braad --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4aea2ac..1d523da 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,6 @@ containerized: rm -rf bin/ obj/ ${CONTAINER_RUNTIME} build -t dotnet-build -f images/Dockerfile.fedora . ${CONTAINER_RUNTIME} run --name runingenie-build dotnet-build sh -c "dotnet restore && dotnet publish -c Release -r win-x64" - ${CONTAINER_RUNTIME} cp runingenie-build:/app/bin ./bin + ${CONTAINER_RUNTIME} cp runingenie-build:/app/bin . ${CONTAINER_RUNTIME} rm runingenie-build #${CONTAINER_RUNTIME} rmi dotnet-build # this forces a rebuild of the toolchain each time