24 lines
614 B
C#
24 lines
614 B
C#
|
|
namespace Yes.Application.Admins.Themes
|
|
{
|
|
public class ThemeService(IWebHostEnvironment env) : IThemeService
|
|
{
|
|
private readonly IWebHostEnvironment _env = env;
|
|
|
|
|
|
public void CheckThemeExists(string theme)
|
|
{
|
|
var themePath = Path.Combine(_env.ContentRootPath, "files", "themes");
|
|
|
|
var directories = Directory.GetDirectories(themePath);
|
|
|
|
var jsonPath = Path.Combine(themePath, theme, "config.json");
|
|
|
|
if (!File.Exists(jsonPath))
|
|
{
|
|
throw new ThemeNotExistsException(theme);
|
|
}
|
|
}
|
|
}
|
|
}
|