feat: commit code
This commit is contained in:
1 parent
2065193b63
commit
59acefadc9
4 files changed
+34
-32
No files matched your search
@@ -59,27 +59,6 @@ impl UserData for PluginCommander {
|
||||
Ok(())
|
||||
},
|
||||
);
|
||||
methods.add_function("execQuiet", |_, cmd: Vec<String>| {
|
||||
if cmd.len() == 0 {
|
||||
return Ok(());
|
||||
}
|
||||
let cmd_name = cmd.get(0).unwrap();
|
||||
let mut command = Command::new(cmd_name);
|
||||
let t = cmd
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(i, _)| *i > 0)
|
||||
.map(|v| v.1.clone())
|
||||
.collect::<Vec<String>>();
|
||||
command.args(t);
|
||||
command.stdout(Stdio::null());
|
||||
command.output()?;
|
||||
Ok(())
|
||||
});
|
||||
methods.add_function("execSimple", |_, cmd: String| {
|
||||
let _ = Command::new(cmd).stdout(Stdio::inherit()).output()?;
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
|
||||
fn add_fields<'lua, F: mlua::UserDataFields<'lua, Self>>(_fields: &mut F) {}
|
||||
|
||||
Reference in new issue
Block a user