Beispiel #1
0
    string CreateToolsDirectory(string solutionDirectory)
    {
        var fodyDirectory = FodyDirectoryFinder.TreeWalkForToolsFodyDir(solutionDirectory);

        if (fodyDirectory != null)
        {
            return(fodyDirectory);
        }
        var packagesPath = NugetConfigReader.GetPackagesPathFromConfig(solutionDirectory);

        if (packagesPath != null)
        {
            fodyDirectory = Path.Combine(Directory.GetParent(packagesPath).FullName, @"Tools\Fody");
        }
        else
        {
            fodyDirectory = Path.Combine(solutionDirectory, @"Tools\Fody");
        }
        if (!Directory.Exists(fodyDirectory))
        {
            Directory.CreateDirectory(fodyDirectory);
        }
        return(fodyDirectory);
    }
Beispiel #2
0
 public void ProcessTaskFile(string solutionDirectory)
 {
     try
     {
         var fodyDir = FodyDirectoryFinder.TreeWalkForToolsFodyDir(solutionDirectory);
         if (fodyDir != null)
         {
             var fodyFile = Path.Combine(fodyDir, "Fody.dll");
             if (File.Exists(fodyFile))
             {
                 Check(fodyFile);
                 return;
             }
         }
         foreach (var filePath in Directory.EnumerateFiles(solutionDirectory, "Fody.dll", SearchOption.AllDirectories))
         {
             Check(filePath);
         }
     }
     catch (Exception exception)
     {
         messageDisplayer.ShowError(string.Format("Fody: An exception occured while trying to check for updates.\r\nException: {0}.", exception));
     }
 }
    public void Existing()
    {
        var fodyDir = FodyDirectoryFinder.TreeWalkForToolsFodyDir(AssemblyLocation.CurrentDirectory());

        Assert.IsTrue(Directory.Exists(fodyDir));
    }
 public void NotExisting()
 {
     Assert.IsNull(FodyDirectoryFinder.TreeWalkForToolsFodyDir(Path.GetTempPath()));
 }