From 0a2504dbda3aad2c169369136007b612c402546b Mon Sep 17 00:00:00 2001 From: Someon1e <142684596+Someon1e@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:46:06 +0100 Subject: [PATCH] Fix missing directory error --- src/lune/globals/require/path.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lune/globals/require/path.rs b/src/lune/globals/require/path.rs index 29e080c..6c8496d 100644 --- a/src/lune/globals/require/path.rs +++ b/src/lune/globals/require/path.rs @@ -124,7 +124,10 @@ fn append_extension(path: impl Into, ext: &'static str) -> PathBuf { fn is_file_not_found_error(err: &LuaError) -> bool { if let ExternalError(err) = err { if let Some(err) = err.as_ref().downcast_ref::() { - err.kind() == ErrorKind::NotFound + matches!( + err.kind(), + ErrorKind::NotFound | ErrorKind::PermissionDenied + ) } else { false }