Пример #1
0
        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");
            }
        }
Пример #2
0
 public static async Task <string?> GetProfileNameOrDefault(string?profileName)
 {
     return(string.IsNullOrEmpty(profileName) ?
            await JiraProfileService.GetDefaultProfileName() :
            profileName);
 }
Пример #3
0
 private static async Task <bool> CheckHasProfiles()
 {
     return((await JiraProfileService.GetAvailableProfiles())
            .Count() > 0);
 }