mirror of
https://github.com/Raine-gay/royal_road_archiver.git
synced 2024-11-14 19:38:42 -06:00
trying to make windows pathbuf conversion work
This commit is contained in:
parent
7b8a9ab2df
commit
141f9c59f4
|
@ -2,8 +2,11 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
mod book;
|
mod book;
|
||||||
mod html;
|
mod html;
|
||||||
mod http;
|
mod http;
|
||||||
|
@ -123,8 +126,6 @@ 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")] {
|
||||||
use path_slash::PathBufExt as _;
|
|
||||||
|
|
||||||
return PathBuf::from_slash(path);
|
return PathBuf::from_slash(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue