Last active
August 29, 2015 14:20
-
-
Save andy-uq/5f04bb28464111bedcbb to your computer and use it in GitHub Desktop.
Return the current solution directory, useful for tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetBuildDirectory() | |
{ | |
var solution = Environment.GetEnvironmentVariable("NCrunch.OriginalSolutionPath"); | |
if (!string.IsNullOrEmpty(solution)) | |
return Path.GetDirectoryName(solution); | |
var teamCityLocation = Environment.GetEnvironmentVariable("teamcity.build.checkoutDir"); | |
if (!string.IsNullOrEmpty(teamCityLocation)) | |
{ | |
return teamCityLocation; | |
} | |
return Path.Combine(Environment.CurrentDirectory, "../../.."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment