private async Task OnExecute(IConsole console) { if (!All && Version == default && Regex == default) { console.WriteErrorAndExit("You should pass a runtime --version, --regex or the --all option to remove runtime/s"); } var installed = await DotnetPackages.Get(PackageType.Runtime, console); if (!All && Regex == default) { var target = installed.FirstOrDefault(i => i.version == Version); if (target.version == default) { console.WriteErrorAndExit($"Runtime version {Version} was not found"); } removeRuntime(target.version, target.props, console); return; } if (Regex != default) { console.WriteLine($"Removing runtimes using regex: {Regex}"); DotnetRuntime.RemoveWithRegex(Regex, console); return; } foreach (var runtime in installed) { removeRuntime(runtime.version, runtime.props, console); } }
private async Task OnExecute(IConsole console) { var installed = await DotnetPackages.Get(PackageType.Sdk, console); console.WriteWithCheck("Installed SDKs"); foreach (var sdk in installed) { console.WriteLine($"{sdk.props} ➡ {sdk.version}"); } }
private async Task OnExecute(IConsole console) { var installed = await DotnetPackages.Get(PackageType.Runtime, console); console.WriteWithCheck("Installed runtimes"); foreach (var runtime in installed.GroupBy( x => x.version, (key, g) => new { package = key, pkgs = g.ToList().Select(g => g.props) })) { console.WriteLine($"{runtime.package} ➡ [{String.Join(" | ", runtime.pkgs)}]"); } }
private async Task OnExecute(IConsole console) { if (!All && Version == default) { console.WriteErrorAndExit("You should pass a sdk --version, --glob or the --all option"); } if (!All) { RemoveSdk(Version, console); return; } var installed = await DotnetPackages.Get(PackageType.Sdk, console); foreach (var sdk in installed) { RemoveSdk(sdk.props, console); } }