From f0ab94891e23d5ef1751440fe4e709fc7516086b Mon Sep 17 00:00:00 2001 From: yudai Date: Sun, 3 Nov 2024 20:33:07 +0900 Subject: [PATCH] feat: Show commit hash when using `ya pack -l` --- yazi-cli/src/package/parser.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/yazi-cli/src/package/parser.rs b/yazi-cli/src/package/parser.rs index 49a22a40..ae9c868a 100644 --- a/yazi-cli/src/package/parser.rs +++ b/yazi-cli/src/package/parser.rs @@ -81,9 +81,13 @@ impl Package { println!("{section}s:"); for dep in deps { - if let Some(Value::String(use_)) = dep.as_inline_table().and_then(|t| t.get("use")) { - println!("\t{}", use_.value()); - } + let Some(Value::String(use_)) = dep.as_inline_table().and_then(|t| t.get("use")) else { + return Ok(()); + }; + let Some(Value::String(rev)) = dep.as_inline_table().and_then(|t| t.get("rev")) else { + return Ok(()); + }; + println!("\t{} ({})", use_.value(), rev.value()); } Ok(()) }