From 73a4599fb6946a5b8c93f2f31124806d634402a4 Mon Sep 17 00:00:00 2001 From: NA Date: Fri, 26 Jan 2024 16:17:48 +0000 Subject: [PATCH] Removed the check relating to being able to write in the target directory. It was broken on windows. --- src/binary.rs | 6 ------ src/file_system_crap.rs | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/binary.rs b/src/binary.rs index 454f4cc..4ffde8a 100644 --- a/src/binary.rs +++ b/src/binary.rs @@ -75,12 +75,6 @@ fn valid_directory_check(output_directory: &Path) { } } } - - // Check if the user has write permissions: - if fs::metadata(output_directory).unwrap().permissions().readonly() { - eprintln!("Error! You do not have permissions for the specified directory."); - exit(1); - } } // Check if the given URL is a valid royalroad url. diff --git a/src/file_system_crap.rs b/src/file_system_crap.rs index ec71861..300f6e9 100644 --- a/src/file_system_crap.rs +++ b/src/file_system_crap.rs @@ -30,7 +30,8 @@ pub fn remove_illegal_chars(mut string: String) -> String { /// Setup html2xhtml in the operating system's temp directory. pub fn setup_html2xhtml() -> TempDir { #[cfg(target_os = "windows")] { - const HTML2XHTML: &[u8; 268299] = include_bytes!(r"..\html2xhtml-windows.zip"); + const HTML2XHTML: &[u8; 268299] = include_bytes!("../html2xhtml-windows.zip"); // This will not compile on windows due to this and no I don't give a shit. + // Compile it on linux for windows like a sane person. let html2xhtml_dir = match TempDir::new("html2xhtml-windows") { Ok(temp_dir) => temp_dir, Err(error) => {