From 08abbf38c6809deff819040466717ed375b7f9aa Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Thu, 8 Apr 2021 15:02:32 +0800 Subject: [PATCH] revert: #1297 --- .../java/run/halo/app/config/properties/HaloProperties.java | 6 ------ src/main/java/run/halo/app/listener/StartedListener.java | 6 +----- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/main/java/run/halo/app/config/properties/HaloProperties.java b/src/main/java/run/halo/app/config/properties/HaloProperties.java index 393202ca74..5242c35f78 100644 --- a/src/main/java/run/halo/app/config/properties/HaloProperties.java +++ b/src/main/java/run/halo/app/config/properties/HaloProperties.java @@ -22,12 +22,6 @@ @ConfigurationProperties("halo") public class HaloProperties { - /** - * Production env. (Default is true) - */ - @Deprecated - private boolean productionEnv = true; - /** * Authentication enabled. */ diff --git a/src/main/java/run/halo/app/listener/StartedListener.java b/src/main/java/run/halo/app/listener/StartedListener.java index ef4fd679a9..9bff9aaa3f 100644 --- a/src/main/java/run/halo/app/listener/StartedListener.java +++ b/src/main/java/run/halo/app/listener/StartedListener.java @@ -146,10 +146,6 @@ private void initThemes() { Boolean isInstalled = optionService .getByPropertyOrDefault(PrimaryProperties.IS_INSTALLED, Boolean.class, false); - if (isInstalled) { - return; - } - try { String themeClassPath = ResourceUtils.CLASSPATH_URL_PREFIX + ThemeService.THEME_FOLDER; @@ -172,7 +168,7 @@ private void initThemes() { Path themePath = themeService.getBasePath(); // Fix the problem that the project cannot start after moving to a new server - if (!haloProperties.getMode().isProductionEnv() || Files.notExists(themePath)) { + if (Files.notExists(themePath) || !isInstalled) { FileUtils.copyFolder(source, themePath); log.debug("Copied theme folder from [{}] to [{}]", source, themePath); } else {