private static async Task CreateNewProfile() { var count = (await JiraProfileService.GetAvailableProfiles()).Count(); var profile = await ConsoleI.RenderForm <TerminalJiraProfile>(); var isDefault = ConsoleI.AskConfirmation("Set as default profile"); var service = await JiraProfileService.Create(profile, ""); Console.WriteLine("Created profile " + profile.ProfileName); if (count == 0 || isDefault) { await service.SetAsDefault(); Console.WriteLine("Profile set as default"); } }
public static async Task <string?> GetProfileNameOrDefault(string?profileName) { return(string.IsNullOrEmpty(profileName) ? await JiraProfileService.GetDefaultProfileName() : profileName); }
private static async Task <bool> CheckHasProfiles() { return((await JiraProfileService.GetAvailableProfiles()) .Count() > 0); }