mirror of https://github.com/halo-dev/halo
Merge pull request #248 from jinqilin721/dev
Fix the problem that the project cannot start after moving to a new serverpull/251/head
commit
b5294ed09c
|
@ -66,10 +66,10 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
|
||||||
// Whether the blog has initialized
|
// Whether the blog has initialized
|
||||||
Boolean isInstalled = optionService.getByPropertyOrDefault(PrimaryProperties.IS_INSTALLED, Boolean.class, false);
|
Boolean isInstalled = optionService.getByPropertyOrDefault(PrimaryProperties.IS_INSTALLED, Boolean.class, false);
|
||||||
|
|
||||||
if (haloProperties.isProductionEnv() && isInstalled) {
|
/*if (haloProperties.isProductionEnv() && isInstalled) {
|
||||||
// Skip
|
// Skip
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String themeClassPath = ResourceUtils.CLASSPATH_URL_PREFIX + ThemeService.THEME_FOLDER;
|
String themeClassPath = ResourceUtils.CLASSPATH_URL_PREFIX + ThemeService.THEME_FOLDER;
|
||||||
|
@ -91,7 +91,8 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
|
||||||
// Create theme folder
|
// Create theme folder
|
||||||
Path themePath = themeService.getBasePath();
|
Path themePath = themeService.getBasePath();
|
||||||
|
|
||||||
if (!haloProperties.isProductionEnv() || Files.notExists(themePath)) {
|
// Fix the problem that the project cannot start after moving to a new server
|
||||||
|
if (!haloProperties.isProductionEnv() || Files.notExists(themePath) || !isInstalled) {
|
||||||
FileUtils.copyFolder(source, themePath);
|
FileUtils.copyFolder(source, themePath);
|
||||||
log.info("Copied theme folder from [{}] to [{}]", source, themePath);
|
log.info("Copied theme folder from [{}] to [{}]", source, themePath);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue