From b2ec9a71a3c53832fc0bdee1243aee5625bc6ce8 Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Tue, 18 Feb 2025 15:34:35 -0500 Subject: [PATCH 1/2] fix: Adjust debug parameters for vscode --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8e2382a2..536df9da 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,7 @@ "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. "program": "${workspaceFolder}/UnoCheck/bin/Debug/netcoreapp3.1/UnoCheck.dll", - "args":["-v", "--manifest", "https://raw.githubusercontent.com/unoplatform/uno.check/bf3684e2ad725baa66da3573759129d6bb1d8817/manifests/uno.ui.manifest.json"], + "args":["-v", "--non-interactive", "--manifest", "${workspaceFolder}/manifests/uno.ui.manifest.json"], "cwd": "${workspaceFolder}/UnoCheck", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console "console": "internalConsole", From 851fb1f080c2555f5206ee8a2ab643644049d4c2 Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Tue, 18 Feb 2025 15:35:05 -0500 Subject: [PATCH 2/2] fix: Don't require sudo for dotnet workloads validation --- UnoCheck/DotNet/DotNetWorkloadManager.cs | 4 ++-- UnoCheck/Util.cs | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/UnoCheck/DotNet/DotNetWorkloadManager.cs b/UnoCheck/DotNet/DotNetWorkloadManager.cs index 99d93c66..59c2c2b0 100644 --- a/UnoCheck/DotNet/DotNetWorkloadManager.cs +++ b/UnoCheck/DotNet/DotNetWorkloadManager.cs @@ -102,7 +102,7 @@ public async Task GetInstalledWorkloads() "--machine-readable" }; - var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, Util.Verbose, args.ToArray()); + var r = await Util.ShellCommand(dotnetExe, DotNetCliWorkingDir, Util.Verbose, args.ToArray()); // Throw if this failed with a bad exit code if (r.ExitCode != 0) @@ -127,7 +127,7 @@ public async Task GetInstalledWorkloads() "--print-rollback" }; - var r = await Util.WrapShellCommandWithSudo(dotnetExe, DotNetCliWorkingDir, Util.Verbose, args.ToArray()); + var r = await Util.ShellCommand(dotnetExe, DotNetCliWorkingDir, Util.Verbose, args.ToArray()); // Throw if this failed with a bad exit code if (r.ExitCode != 0) diff --git a/UnoCheck/Util.cs b/UnoCheck/Util.cs index 981b9817..6c53644c 100644 --- a/UnoCheck/Util.cs +++ b/UnoCheck/Util.cs @@ -198,6 +198,12 @@ public static bool Delete(string path, bool isFile) return false; } + public static Task ShellCommand(string cmd, string workingDir, bool verbose, string[] args) + { + var cli = new ShellProcessRunner(new ShellProcessRunnerOptions(cmd, string.Join(" ", args)) { WorkingDirectory = workingDir, Verbose = verbose } ); + return Task.FromResult(cli.WaitForExit()); + } + public static Task WrapShellCommandWithSudo(string cmd, string[] args) => WrapShellCommandWithSudo(cmd, null, false, args);