Revert "Fix error loading non-existant themes directory and use default themes as the base when merging (#2411)" (#2562)

This reverts commit 48e75d0559.
This commit is contained in:
Jae-Heon Ji 2023-06-19 00:18:57 +09:00 committed by GitHub
parent 4102a14e5c
commit a35bdb71e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -320,18 +320,13 @@ impl Setup {
None => config.options.clone(),
};
config.themes = get_default_themes().merge(config.themes);
config.themes = config.themes.merge(get_default_themes());
if let Some(Command::Setup(Setup { clean: false, .. })) = &cli_args.command {
let user_theme_dir = config_options.theme_dir.clone().or_else(|| {
get_theme_dir(cli_args.config_dir.clone().or_else(find_default_config_dir))
// If theme dir is not explicitly specified in config_options,
// only try to use it if it exists.
.filter(|dir| dir.exists())
});
if let Some(user_theme_dir) = user_theme_dir {
config.themes = config.themes.merge(Themes::from_dir(user_theme_dir)?);
}
let user_theme_dir = config_options.theme_dir.clone().or_else(|| {
get_theme_dir(cli_args.config_dir.clone().or_else(find_default_config_dir))
});
if let Some(user_theme_dir) = user_theme_dir {
config.themes = config.themes.merge(Themes::from_dir(user_theme_dir)?);
}
if let Some(Command::Setup(ref setup)) = &cli_args.command {