[F] Fix macchina #491

This commit is contained in:
2026-04-07 01:55:11 +00:00
parent 9500e8c0aa
commit 13e56f621b
+7 -3
View File
@@ -509,7 +509,7 @@ pub fn get_distro_name(backend: Backend) -> Result<String> {
doc["spacing"] = value(0); doc["spacing"] = value(0);
doc["padding"] = value(0); doc["padding"] = value(0);
// See https://github.com/Macchina-CLI/macchina/issues/319 // See https://github.com/Macchina-CLI/macchina/issues/319
// doc["hide_ascii"] = value(true); doc["hide_ascii"] = value(false);
doc["separator"] = value(""); doc["separator"] = value("");
doc["custom_ascii"] = Item::Table(Table::from_iter([( doc["custom_ascii"] = Item::Table(Table::from_iter([(
"path", "path",
@@ -540,8 +540,11 @@ pub fn get_distro_name(backend: Backend) -> Result<String> {
]; ];
run_macchina_command_piped(&args[..]) run_macchina_command_piped(&args[..])
.map(|s| { .map(|s| {
anstream::adapter::strip_str(&s) let s = anstream::adapter::strip_str(&s).to_string();
.to_string() let s = s.trim();
s.splitn(2, '-')
.last()
.expect("splitn with 2 should always have at least 1 element")
.trim() .trim()
.to_owned() .to_owned()
}) })
@@ -661,6 +664,7 @@ fn run_macchina(asc: String, args: Option<&Vec<String>>) -> Result<()> {
.context("failed to create temp file for macchina theme")?; .context("failed to create temp file for macchina theme")?;
let theme_doc = { let theme_doc = {
let mut doc = DocumentMut::new(); let mut doc = DocumentMut::new();
doc["hide_ascii"] = value(false);
doc["custom_ascii"] = Item::Table(Table::from_iter([( doc["custom_ascii"] = Item::Table(Table::from_iter([(
"path", "path",
&*asc_file_path.to_string_lossy(), &*asc_file_path.to_string_lossy(),