From 99b1885dec0dd615231d0bc8e56ead3d6769a7f4 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 3 Mar 2022 05:58:44 +0100 Subject: [PATCH] Include contents of custom assets `metadata.yaml` in `--diagnostics` --- CHANGELOG.md | 2 ++ src/bin/bat/main.rs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19357659a8..0cbac18407 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ## Other +- Include contents of custom assets `metadata.yaml` in `--diagnostics`. See #2107 (@Enselic) + ## Syntaxes ## Themes diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 6232c9b36f..7275c94a51 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -230,6 +230,9 @@ fn invoke_bugreport(app: &App) { let pager = bat::config::get_pager_executable(app.matches.value_of("pager")) .unwrap_or_else(|| "less".to_owned()); // FIXME: Avoid non-canonical path to "less". + let mut custom_assets_metadata = PROJECT_DIRS.cache_dir().to_path_buf(); + custom_assets_metadata.push("metadata.yaml"); + let mut report = bugreport!() .info(SoftwareVersion::default()) .info(OperatingSystem::default()) @@ -254,6 +257,10 @@ fn invoke_bugreport(app: &App) { "MANPAGER", ])) .info(FileContent::new("Config file", config_file())) + .info(FileContent::new( + "Custom assets metadata", + custom_assets_metadata, + )) .info(CompileTimeInformation::default()); #[cfg(feature = "paging")]