chore: use rosetta
This commit is contained in:
1 parent
230c83c35b
commit
479ee2a0f1
15 files changed
+203
-382
No files matched your search
@@ -37,7 +37,6 @@ impl UserData for PluginCommander {
|
||||
methods.add_function(
|
||||
"exec",
|
||||
|_, args: (Vec<String>, StdioFromString, StdioFromString)| {
|
||||
|
||||
let cmd = args.0;
|
||||
let stdout = args.1;
|
||||
let stderr = args.2;
|
||||
|
||||
@@ -10,4 +10,4 @@ impl UserData for PluginDirs {
|
||||
Ok(path.to_str().unwrap().to_string())
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
use std::{
|
||||
fs::{create_dir, create_dir_all, remove_dir_all},
|
||||
path::PathBuf, io::{Read, Write},
|
||||
fs::{create_dir, create_dir_all, remove_dir_all, File},
|
||||
io::{Read, Write},
|
||||
path::PathBuf,
|
||||
};
|
||||
use std::fs::File;
|
||||
|
||||
use mlua::UserData;
|
||||
use flate2::read::GzDecoder;
|
||||
use tar::Archive;
|
||||
use crate::tools::extract_zip;
|
||||
use flate2::read::GzDecoder;
|
||||
use mlua::UserData;
|
||||
use tar::Archive;
|
||||
|
||||
pub struct PluginFileSystem;
|
||||
impl UserData for PluginFileSystem {
|
||||
@@ -49,9 +49,9 @@ impl UserData for PluginFileSystem {
|
||||
}
|
||||
|
||||
if file.unwrap().write_all(content.as_bytes()).is_err() {
|
||||
return Ok(false)
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
|
||||
Ok(true)
|
||||
});
|
||||
methods.add_function("unzip_file", |_, args: (String, String)| {
|
||||
@@ -64,7 +64,6 @@ impl UserData for PluginFileSystem {
|
||||
Ok(true)
|
||||
});
|
||||
methods.add_function("untar_gz_file", |_, args: (String, String)| {
|
||||
|
||||
let file = PathBuf::from(args.0);
|
||||
let target = PathBuf::from(args.1);
|
||||
|
||||
@@ -80,7 +79,6 @@ impl UserData for PluginFileSystem {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
|
||||
Ok(true)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,4 +25,4 @@ impl UserData for PluginLogger {
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,4 +15,4 @@ impl UserData for PluginOS {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ impl UserData for PluginPath {
|
||||
path = path.join(i);
|
||||
}
|
||||
Ok(path.to_str().unwrap().to_string())
|
||||
});
|
||||
});
|
||||
|
||||
// parent function
|
||||
methods.add_function("parent", |_, path: String| {
|
||||
|
||||
+4
-3
@@ -13,10 +13,9 @@ use crate::{
|
||||
};
|
||||
|
||||
use self::{
|
||||
interface::PluginInfo,
|
||||
interface::{
|
||||
command::PluginCommander, dirs::PluginDirs, fs::PluginFileSystem, log::PluginLogger,
|
||||
network::PluginNetwork, os::PluginOS, path::PluginPath,
|
||||
network::PluginNetwork, os::PluginOS, path::PluginPath, PluginInfo,
|
||||
},
|
||||
types::PluginConfig,
|
||||
};
|
||||
@@ -143,7 +142,9 @@ impl PluginManager {
|
||||
}
|
||||
}
|
||||
Ok(false) => {
|
||||
log::warn!("Plugin init function result is `false`, init failed.");
|
||||
log::warn!(
|
||||
"Plugin init function result is `false`, init failed."
|
||||
);
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!("Plugin init failed: {e}");
|
||||
|
||||
Reference in new issue
Block a user