feat: commit code
This commit is contained in:
1 parent
b59e41eaee
commit
e2852a60d1
2 files changed
+4
-4
No files matched your search
@@ -10,10 +10,6 @@ use crate::tools::extract_zip;
|
||||
pub struct PluginFileSystem;
|
||||
impl UserData for PluginFileSystem {
|
||||
fn add_methods<'lua, M: mlua::UserDataMethods<'lua, Self>>(methods: &mut M) {
|
||||
methods.add_function("exists", |_, path: String| {
|
||||
let path = PathBuf::from(path);
|
||||
Ok(path.exists())
|
||||
});
|
||||
methods.add_function("create_dir", |_, args: (String, bool)| {
|
||||
let path = args.0;
|
||||
let recursive = args.1;
|
||||
|
||||
@@ -22,6 +22,10 @@ impl UserData for PluginPath {
|
||||
return Ok(parent.unwrap().to_str().unwrap().to_string());
|
||||
}
|
||||
});
|
||||
methods.add_function("exists", |_, path: String| {
|
||||
let path = PathBuf::from(path);
|
||||
Ok(path.exists())
|
||||
});
|
||||
methods.add_function("is_dir", |_, path: String| {
|
||||
let path = PathBuf::from(path);
|
||||
Ok(path.is_dir())
|
||||
|
||||
Reference in new issue
Block a user