Ejemplo n.º 1
0
 public GitStatusCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness)
     : base(settingAgent, "Status", new[] { "status" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
 }
Ejemplo n.º 2
0
 public GitOpenCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, IQuestionAgent questionAgent, ITalkAgent talkAgent)
     : base(settingAgent, "Open", new[] { "open repo", "open repository" })
 {
     _repositoryBusiness = repositoryBusiness;
     _questionAgent      = questionAgent;
     _talkAgent          = talkAgent;
 }
Ejemplo n.º 3
0
 public GitUnstageCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness)
     : base(settingAgent, "Unstage", new[] { "unstage", "remove", "soft reset", "reset soft" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
 }
Ejemplo n.º 4
0
 public GitRebaseCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness)
     : base(settingAgent, "Rebase", new[] { "rebase" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
 }
Ejemplo n.º 5
0
 public GitCommitCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "Commit", new[] { "commit", "stage and commit", "stage commit", "amend" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Ejemplo n.º 6
0
 public GitStashPopCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "Pop", new[] { "stash pop", "pop", "pop the stash", "pop stash" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Ejemplo n.º 7
0
 public GitPullCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "pull", new[] { "pull" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Ejemplo n.º 8
0
 public GitResetHardCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "Reset", new[] { "reset hard", "hard reset" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Ejemplo n.º 9
0
 public GitStashCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, IGitBusiness gitBusiness, IQuestionAgent questionAgent)
     : base(settingAgent, "Stash", new[] { "stash", "stash save", "save stash", "save to stash" })
 {
     _repositoryBusiness = repositoryBusiness;
     _talkAgent          = talkAgent;
     _gitBusiness        = gitBusiness;
     _questionAgent      = questionAgent;
 }
Ejemplo n.º 10
0
        public GitSelectCommand(ISettingAgent settingAgent, IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent)
            : base(settingAgent, "Select", new string[] { })
        {
            _repositoryBusiness = repositoryBusiness;
            _talkAgent          = talkAgent;

            var repos = settingAgent.GetSettings <string>("Repositories");

            foreach (var repo in repos)
            {
                var rawPhrases = GetRawList();
                AddPhrases(repo.Key, rawPhrases.Select(x => x.Replace("{RepositoryName}", repo.Key)).ToArray());
            }

            repositoryBusiness.RepositoryAddedEvent += RepositoryBusiness_RepositoryAddedEvent;
        }
Ejemplo n.º 11
0
        public static async Task <string> GetSelectedPathAsync(IRepositoryBusines repositoryBusiness, ITalkAgent talkAgent, ISettingAgent settingAgent)
        {
            var gitRepoPath = repositoryBusiness.GetSelectedPath();

            if (string.IsNullOrEmpty(gitRepoPath))
            {
                var repos = settingAgent.GetSettings <string>("Repositories");
                if (!repos.Any())
                {
                    await talkAgent.SayAsync("You need to open a repository before you can ask for status.");
                }
                else
                {
                    await talkAgent.SayAsync("You need to select a repository before you can ask for status.");
                }
            }

            return(gitRepoPath);
        }
Ejemplo n.º 12
0
 public GitRepoAgent(ITalkAgent talkAgent, IRepositoryBusines repositoryBusiness)
 {
     _talkAgent          = talkAgent;
     _repositoryBusiness = repositoryBusiness;
 }