mirror of https://github.com/halo-dev/halo
parent
eed1ef379d
commit
1a3254deba
|
@ -22,12 +22,6 @@ import run.halo.app.model.enums.Mode;
|
||||||
@ConfigurationProperties("halo")
|
@ConfigurationProperties("halo")
|
||||||
public class HaloProperties {
|
public class HaloProperties {
|
||||||
|
|
||||||
/**
|
|
||||||
* Production env. (Default is true)
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
private boolean productionEnv = true;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authentication enabled.
|
* Authentication enabled.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -146,10 +146,6 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
|
||||||
Boolean isInstalled = optionService
|
Boolean isInstalled = optionService
|
||||||
.getByPropertyOrDefault(PrimaryProperties.IS_INSTALLED, Boolean.class, false);
|
.getByPropertyOrDefault(PrimaryProperties.IS_INSTALLED, Boolean.class, false);
|
||||||
|
|
||||||
if (isInstalled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String themeClassPath = ResourceUtils.CLASSPATH_URL_PREFIX + ThemeService.THEME_FOLDER;
|
String themeClassPath = ResourceUtils.CLASSPATH_URL_PREFIX + ThemeService.THEME_FOLDER;
|
||||||
|
|
||||||
|
@ -172,7 +168,7 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
|
||||||
Path themePath = themeService.getBasePath();
|
Path themePath = themeService.getBasePath();
|
||||||
|
|
||||||
// Fix the problem that the project cannot start after moving to a new server
|
// 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);
|
FileUtils.copyFolder(source, themePath);
|
||||||
log.debug("Copied theme folder from [{}] to [{}]", source, themePath);
|
log.debug("Copied theme folder from [{}] to [{}]", source, themePath);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue