Unified · Split
| @@ -19,7 +19,7 @@ impl Support { · 18 unmodified lines | |||
| 19 | } | 19 | } |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | pub fn display_to_tty(&self, path: &Path) -> io::Result<()> { | 22 | pub fn display_to_tty(&self, path: &Path, path_for_title: &Path) -> io::Result<()> { |
| 23 | if !self.bat.found { | 23 | if !self.bat.found { |
| 24 | log::info!( | 24 | log::info!( |
| 25 | "Would want to use 'bat' for colored preview of '{}', but it wasn't available in the PATH.", | 25 | "Would want to use 'bat' for colored preview of '{}', but it wasn't available in the PATH.", |
| @@ -28,7 +28,8 @@ impl Support { · 2 unmodified lines | |||
| 28 | return Ok(()); | 28 | return Ok(()); |
| 29 | } | 29 | } |
| 30 | if Command::new("bat") | 30 | if Command::new("bat") |
| 31 | .args(&["--paging=always", "-l=md"]) | 31 | .args(&["--paging=always", "-l=md", "--file-name"]) |
| 32 | .arg(path_for_title) | ||
| 32 | .arg(path) | 33 | .arg(path) |
| 33 | .status()? | 34 | .status()? |
| 34 | .success() | 35 | .success() |
| @@ -50,7 +50,10 @@ pub fn changelog(opts: Options, crates: Vec<String>) -> anyhow::Result<()> { · 49 unmodified lines | |||
| 50 | file.write_all(buf.as_bytes()) | 50 | file.write_all(buf.as_bytes()) |
| 51 | })?; | 51 | })?; |
| 52 | if let Some(bat) = bat.as_ref() { | 52 | if let Some(bat) = bat.as_ref() { |
| 53 | bat.display_to_tty(lock.lock_path())?; | 53 | bat.display_to_tty( |
| 54 | lock.lock_path(), | ||
| 55 | lock.resource_path().strip_prefix(&ctx.root.to_path_buf())?, | ||
| 56 | )?; | ||
| 54 | } | 57 | } |
| 55 | if !opts.dry_run { | 58 | if !opts.dry_run { |
| 56 | pending_changes.push(lock); | 59 | pending_changes.push(lock); |
| @@ -239,7 +239,10 @@ pub(in crate::command::release_impl) fn edit_version_and_fixup_dependent_crates_ · 238 unmodified lines | |||
| 239 | .iter() | 239 | .iter() |
| 240 | .filter(|(_, has_changes, _)| *has_changes) | 240 | .filter(|(_, has_changes, _)| *has_changes) |
| 241 | { | 241 | { |
| 242 | bat.display_to_tty(lock.lock_path())?; | 242 | bat.display_to_tty( |
| 243 | lock.lock_path(), | ||
| 244 | lock.resource_path().strip_prefix(&ctx.base.root.to_path_buf())?, | ||
| 245 | )?; | ||
| 243 | } | 246 | } |
| 244 | } | 247 | } |
| 245 | 248 | ||