Ejemplo n.º 1
0
        private void Grep(IEnumerable <Dep> toGrep)
        {
            var modules = Helper.GetModules();
            var command = BuildGitCommand(arguments, fileMasks);

            ConsoleWriter.WriteInfo(command);
            ConsoleWriter.WriteLine();

            using (new DirectoryJumper(workspace))
            {
                var clonedModules = skipGet
                    ? GetExistingDirectories(toGrep)
                    : CloneModules(toGrep, modules);

                foreach (var module in clonedModules)
                {
                    runner.RunInDirectory(module, command);
                    if (string.IsNullOrWhiteSpace(ShellRunner.LastOutput))
                    {
                        continue;
                    }
                    ConsoleWriter.WriteLine(AddModuleToOutput(ShellRunner.LastOutput, module));
                    ConsoleWriter.WriteLine();
                }
            }
        }
Ejemplo n.º 2
0
 public void TestRunInDirectory()
 {
     using (var temp = new TempDirectory())
     {
         runner.RunInDirectory(temp.Path, "mkdir 1");
         Assert.That(Directory.Exists(Path.Combine(temp.Path, "1")));
     }
 }