public async Task OnExecute(CommandLineApplication app, IConsole console)
        {
            _wsUtils = new WorkrootCommandUtils(app, console);
            await _wsUtils.GetWorkRootsAsync(CommandAborded);

            var services = new List <string>();

            if (Source is { })
Esempio n. 2
0
        public async Task OnExecute(CommandLineApplication app, IConsole console)
        {
            var utils = new WorkrootCommandUtils(app, console);

            IEnumerable <WorkRoot> workroots = await utils.GetWorkRootsAsync(CommandAborded);

            foreach (WorkRoot wr in workroots)
            {
                await _localRepositoryIndexer.IndexWorkRootAsync(
                    wr,
                    onProgress : (msg) => console.WriteLine(msg),
                    CommandAborded);
            }

            console.WriteLine("Repo indexing completed", ConsoleColor.Green);
        }
Esempio n. 3
0
        public async Task OnExecute(CommandLineApplication app, IConsole console)
        {
            var utils = new WorkrootCommandUtils(app, console);
            IEnumerable <WorkRoot> workroots = await utils.GetWorkRootsAsync(CommandAborded);

            console.Write("Searching....");

            GitLocalRepository[] repos = _localRepositoryService
                                         .Search(SearchText)
                                         .ToArray();

            console.ClearLine();

            if (repos.Count() == 0)
            {
                console.WriteLine($"\nNo repo found with search term: {SearchText}.");
                console.WriteLine($"Make sure you have configured your workroots correctly " +
                                  $"and you did index your workroots." +
                                  $"\nRun `boo index` to start indexing all your work roots." +
                                  $"\n\nSearched workroots: " +
                                  $"\n-------------------");

                foreach (Settings.WorkRoot wr in workroots)
                {
                    console.WriteLine($"{wr.Path} | {wr.Name}");
                }

                return;
            }

            int index = 0;

            if (repos.Count() > 1)
            {
                index = console.ChooseFromList(
                    repos.Select(x => $"{x.Name} ({x.WorkRoot})"));
            }

            GitLocalRepository?repo = repos[index];

            await utils.ShowQuickActions(repo.WorkingDirectory);
        }
Esempio n. 4
0
        public async Task OnExecute(CommandLineApplication app, IConsole console)
        {
            var utils = new WorkrootCommandUtils(app, console);

            await utils.ShowQuickActions(_applicationContext.WorkingDirectory.FullName);
        }