4 namespace JetBrains.TeamCity.NuGet.Tests
\r
6 public static class NuGet
\r
8 private static string ourCachedNuGetExe = null;
\r
9 public static string NuGetPath
\r
13 if (ourCachedNuGetExe != null) return ourCachedNuGetExe;
\r
15 string path = typeof(NuGetRunnerTest).Assembly.GetAssemblyDirectory();
\r
19 foreach (var probe in new[] { "nuget.exe", "lib/nuget/1.4/nuget.exe" })
\r
21 string nuget = Path.Combine(path, probe);
\r
22 if (File.Exists(nuget))
\r
23 return ourCachedNuGetExe = nuget;
\r
26 path = Path.GetDirectoryName(path);
\r
27 } while (path != null);
\r
28 throw new Exception("Failed to find NuGet.exe near project");
\r