[F] Fix trying to get backend from non-existing backend
This commit is contained in:
parent
afa3c1dfb9
commit
fa3fc59a5f
1 changed files with 4 additions and 1 deletions
|
|
@ -247,7 +247,10 @@ fn create_config(
|
||||||
});
|
});
|
||||||
debug!(?det_ansi, "detected color mode");
|
debug!(?det_ansi, "detected color mode");
|
||||||
|
|
||||||
let asc = get_distro_ascii(distro, backend).context("failed to get distro ascii")?;
|
// Try to get ascii from given backend first, if it fails, try neofetch backend
|
||||||
|
let asc = get_distro_ascii(distro, backend).or_else(|_| {
|
||||||
|
get_distro_ascii(distro, Backend::Neofetch).context("failed to get distro ascii from neofetch backend")
|
||||||
|
})?;
|
||||||
let asc = asc.to_normalized().context("failed to normalize ascii")?;
|
let asc = asc.to_normalized().context("failed to normalize ascii")?;
|
||||||
let theme = det_bg.map(|bg| bg.theme()).unwrap_or_default();
|
let theme = det_bg.map(|bg| bg.theme()).unwrap_or_default();
|
||||||
let color_mode = det_ansi.unwrap_or(AnsiMode::Ansi256);
|
let color_mode = det_ansi.unwrap_or(AnsiMode::Ansi256);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue