Пример #1
0
        /// <summary>
        /// Set current profile as default
        /// </summary>
        /// <returns></returns>
        public async Task SetAsDefault()
        {
            var settings = FreeJiraSettings.FromInterface(await GetSettings());

            settings.DefaultProfile = GetProfile().ProfileName;
            await FreeJiraSettings.UpdateSettings(settings);
        }
Пример #2
0
        public async Task TestName()
        {
            var settings = await FreeJiraSettings.GetSettings();

            Assert.NotNull(settings);
            Assert.NotNull(settings.Folder);
            Assert.True(settings.Folder.Exists);
        }
Пример #3
0
        public static async Task <int> Main(string[] args)
        {
            var settings = await FreeJiraSettings.GetSettings();

            if (args.Contains("--server") || (settings.StartupMode == StartupMode.Server) && !args.Contains("--terminal"))
            {
                CreateHostBuilder(args, settings.ServerPort).Build().Run();
                return(0);
            }
            else
            {
                return(await Terminal.TerminalHandler.HandleArgs(args));
            }
        }
Пример #4
0
        public static async Task <bool> SetDefaultProfile(string profileName)
        {
            var exist = (await GetAvailableProfiles())
                        .Any(p => p == profileName);

            if (!exist)
            {
                return(false);
            }

            var settings = FreeJiraSettings.FromInterface(await GetSettings());

            settings.DefaultProfile = profileName;
            await FreeJiraSettings.UpdateSettings(settings);

            return(true);
        }
Пример #5
0
 private static Task <IFreeJiraSettings> GetSettings()
 => FreeJiraSettings.GetSettings();