Fix hasOptions bug

pull/146/head
johnniang 2019-04-09 10:38:48 +08:00
parent e098e44d58
commit 81dea867eb
4 changed files with 8 additions and 6 deletions

View File

@ -52,7 +52,7 @@ public class ThemeProperty {
/** /**
* Folder name. * Folder name.
*/ */
private String folderName; private String themePath;
/** /**
* Has options. * Has options.

View File

@ -412,8 +412,8 @@ public class ThemeServiceImpl implements ThemeService {
themeProperty.setVersion(properties.getProperty("theme.version")); themeProperty.setVersion(properties.getProperty("theme.version"));
themeProperty.setAuthor(properties.getProperty("theme.author")); themeProperty.setAuthor(properties.getProperty("theme.author"));
themeProperty.setAuthorWebsite(properties.getProperty("theme.author.website")); themeProperty.setAuthorWebsite(properties.getProperty("theme.author.website"));
themeProperty.setFolderName(themePath.getFileName().toString()); themeProperty.setThemePath(themePath.toString());
themeProperty.setHasOptions(hasOptions(propertyPath)); themeProperty.setHasOptions(hasOptions(themePath));
return themeProperty; return themeProperty;
} catch (IOException e) { } catch (IOException e) {
@ -435,6 +435,8 @@ public class ThemeServiceImpl implements ThemeService {
// Resolve the options path // Resolve the options path
Path optionsPath = themePath.resolve(optionsName); Path optionsPath = themePath.resolve(optionsName);
log.debug("Check options file for path: [{}]", optionsPath);
if (Files.exists(optionsPath)) { if (Files.exists(optionsPath)) {
return true; return true;
} }

View File

@ -1,4 +1,4 @@
theme.id=caicai.anatole theme.id=caicai_anatole
theme.name=Anatole theme.name=Anatole
theme.website=https://github.com/hi-caicai/farbox-theme-Anatole theme.website=https://github.com/hi-caicai/farbox-theme-Anatole
theme.description=A other farbox theme theme.description=A other farbox theme

View File

@ -1,7 +1,7 @@
theme.id=viosey.material theme.id=viosey_material
theme.name=Material theme.name=Material
theme.website=https://github.com/viosey/hexo-theme-material theme.website=https://github.com/viosey/hexo-theme-material
theme.description=Nature, Pure | 原质,纯粹 theme.description=Nature, Pure | ԭ<EFBFBD>ʣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
theme.logo=https://avatars0.githubusercontent.com/u/8141232?s=460&v=4 theme.logo=https://avatars0.githubusercontent.com/u/8141232?s=460&v=4
theme.version=1.0 theme.version=1.0
theme.author=Viosey theme.author=Viosey