Esempio n. 1
0
        protected override void ExecuteTask()
        {
            var currentDirectory = Directory.GetCurrentDirectory();

            try
            {
                Directory.SetCurrentDirectory(WorkingDir);

                var settings  = new SettingsBuilder().Build();
                var service   = new TrelloServiceBuilder(settings).Build();
                var board     = new GetBoardByName(service).Execute(settings.Username, Board);
                var cards     = new GetCards(service).Execute(board, List);
                var gitRunner = new GitRunner(new CommandRunner(), settings.GitCommand);

                RunMerge(gitRunner, cards);
            }
            catch (Exception exception)
            {
                throw new BuildException(exception.Message, Location);
            }
            finally
            {
                Directory.SetCurrentDirectory(currentDirectory);
            }
        }
Esempio n. 2
0
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            IMemCheckTest test = new GetCards(serviceProvider);

            test.DescribeForOpportunityToCancel();
            logger.LogWarning("Opportunity to cancel. Please confirm with Y");
            var input = Console.ReadLine();

            if (input == null || !input.Trim().Equals("y", StringComparison.OrdinalIgnoreCase))
            {
                logger.LogError("User cancellation");
                return;
            }
            try
            {
                await test.RunAsync(dbContext);
            }
            catch (Exception e)
            {
                logger.LogError(e, e.Message);
            }
            logger.LogInformation($"Program terminating");
        }