mirror of https://github.com/halo-dev/halo
Fixed the problem that copying the default theme at halo startup did not use themeId as the theme folder name (#1549)
* fix: 1547 * refactor: replace the string magic value using a static constantpull/1564/head
parent
603c4c6eee
commit
9801bc7a20
|
@ -165,10 +165,10 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
|
|||
}
|
||||
|
||||
// Create theme folder
|
||||
Path themePath = themeService.getBasePath();
|
||||
Path themePath = themeService.getBasePath().resolve(HaloConst.DEFAULT_THEME_ID);
|
||||
|
||||
if (themeService.fetchThemePropertyBy(HaloConst.DEFAULT_THEME_ID).isEmpty()) {
|
||||
FileUtils.copyFolder(source, themePath);
|
||||
FileUtils.copyFolder(source.resolve(HaloConst.DEFAULT_THEME_DIR_NAME), themePath);
|
||||
log.info("Copied theme folder from [{}] to [{}]", source, themePath);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -48,6 +48,11 @@ public class HaloConst {
|
|||
*/
|
||||
public static final String DEFAULT_THEME_ID = "caicai_anatole";
|
||||
|
||||
/**
|
||||
* Default theme directory name.
|
||||
*/
|
||||
public static final String DEFAULT_THEME_DIR_NAME = "anatole";
|
||||
|
||||
/**
|
||||
* Default error path.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue