/// <summary> /// Invoke the view command /// </summary> public async Task InvokeAsync(ViewOptions options) { var packageName = options.Package; try { var package = await _soupApi.GetPackageAsync(packageName); var output = JsonConvert.SerializeObject(package); Log.Info(output); } catch (ApiException ex) { if (ex.StatusCode == HttpStatusCode.NotFound) { Log.Warning("The requested package does not exist."); } else { Log.Error(ex.ToString()); } } }
private async Task <SemanticVersion> GetLatestAsync(string name) { var package = await _soupApi.GetPackageAsync(name); return(package.Latest); }