mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 20:38:44 +00:00
Print themes directory in error message if no themes could be loaded from it.
Before this patch: $ bat cache --init [bat error]: Could not load themes from '{}' After: $ bat cache --init [bat error]: Could not load themes from '/home/user/.config/bat/themes'
This commit is contained in:
parent
556149ad3a
commit
65bb4c7ee6
@ -29,8 +29,12 @@ impl HighlightingAssets {
|
|||||||
let source_dir = dir.unwrap_or_else(|| PROJECT_DIRS.config_dir());
|
let source_dir = dir.unwrap_or_else(|| PROJECT_DIRS.config_dir());
|
||||||
|
|
||||||
let theme_dir = source_dir.join("themes");
|
let theme_dir = source_dir.join("themes");
|
||||||
let theme_set =
|
let theme_set = ThemeSet::load_from_folder(&theme_dir).chain_err(|| {
|
||||||
ThemeSet::load_from_folder(&theme_dir).chain_err(|| "Could not load themes from '{}'")?;
|
format!(
|
||||||
|
"Could not load themes from '{}'",
|
||||||
|
theme_dir.to_string_lossy()
|
||||||
|
)
|
||||||
|
})?;
|
||||||
let mut syntax_set = SyntaxSet::new();
|
let mut syntax_set = SyntaxSet::new();
|
||||||
let syntax_dir = source_dir.join("syntaxes");
|
let syntax_dir = source_dir.join("syntaxes");
|
||||||
if !syntax_dir.exists() {
|
if !syntax_dir.exists() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user