I think this conversion is working now

This commit is contained in:
NA 2024-01-25 17:28:45 +00:00
parent 141f9c59f4
commit 71763b7f07

View file

@ -2,8 +2,6 @@ use std::{fs::OpenOptions, io::Write, path::PathBuf, process::exit};
use chrono::prelude::Local; use chrono::prelude::Local;
use clap::Args; use clap::Args;
#[cfg(target_os = "windows")]
use path_slash::PathBufExt as _;
use url::Url; use url::Url;
@ -126,7 +124,9 @@ pub fn generate_markdown(markdown_args: MarkdownArgs, book_url: Url, output_dire
fn convert_path_to_windows(path: PathBuf) -> PathBuf { fn convert_path_to_windows(path: PathBuf) -> PathBuf {
// If target os is windows. // If target os is windows.
#[cfg(target_os = "windows")] { #[cfg(target_os = "windows")] {
return PathBuf::from_slash(path); use path_slash::PathBufExt as _;
return PathBuf::from_slash(path.into_os_string().into_string().unwrap());
} }
// If target os is not windows. // If target os is not windows.