Merge pull request #248 from jinqilin721/dev

Fix the problem that the project cannot start after moving to a new server
pull/251/head
John Niang 2019-07-18 17:39:24 +08:00 committed by GitHub
commit b5294ed09c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {