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", 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);