Fix the problem that the project cannot start after moving to a new server

pull/248/head
jinqilin721 2019-07-18 17:32:26 +08:00
parent b759380f75
commit 7e0b0eb1f2
1 changed files with 4 additions and 3 deletions

View File

@ -66,10 +66,10 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
// Whether the blog has initialized
Boolean isInstalled = optionService.getByPropertyOrDefault(PrimaryProperties.IS_INSTALLED, Boolean.class, false);
if (haloProperties.isProductionEnv() && isInstalled) {
/*if (haloProperties.isProductionEnv() && isInstalled) {
// Skip
return;
}
}*/
try {
String themeClassPath = ResourceUtils.CLASSPATH_URL_PREFIX + ThemeService.THEME_FOLDER;
@ -91,7 +91,8 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
// Create theme folder
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);
log.info("Copied theme folder from [{}] to [{}]", source, themePath);
} else {