mirror of https://github.com/abpframework/abp.git
5 changed files with 42 additions and 11 deletions
@ -0,0 +1,28 @@ |
|||
using System.IO; |
|||
|
|||
namespace Volo.Abp.AspNetCore.TestBase; |
|||
|
|||
public static class GetWebProjectContentRootPathHelper |
|||
{ |
|||
public static string Get(string webProjectName) |
|||
{ |
|||
var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); |
|||
|
|||
while (currentDirectory != null && Directory.GetParent(currentDirectory.FullName) != null) |
|||
{ |
|||
currentDirectory = Directory.GetParent(currentDirectory.FullName); |
|||
if (currentDirectory == null) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
var files = currentDirectory.GetFiles(webProjectName, SearchOption.AllDirectories); |
|||
if (files.Length > 0) |
|||
{ |
|||
return files[0].DirectoryName!; |
|||
} |
|||
} |
|||
|
|||
throw new AbpException($"Web project({webProjectName}) not found!"); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue