1
0
Fork 0

Add capture all events

This commit is contained in:
Florian RICHER 2023-01-30 23:54:09 +01:00
parent 5046c08817
commit 535abde7c0
2 changed files with 5 additions and 5 deletions

View file

@ -2,8 +2,6 @@
pub mod client;
use std::io::{BufRead, Write};
use std::process::Stdio;
use libcommand::internal::{AuthorizeRequest, AuthorizeResponse};
use tonic::Response;
@ -13,7 +11,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// let arg = std::env::args()
// .skip(1)
// .next().unwrap();
let arg = String::from("{\"command\": \"nu\", \"envs\": {}, \"args\": []}");
let arg = String::from("{\"command\": \"/usr/bin/nu\", \"envs\": {}, \"args\": []}");
let mut command : std::process::Command = serde_json::from_str::<libcommand::Command>(&arg)
.unwrap()
.into();

View file

@ -16,8 +16,10 @@ pub struct Command {
impl Into<std::process::Command> for Command {
fn into(self) -> std::process::Command {
let mut command = std::process::Command::new(self.command);
command.args(self.args);
let mut command = std::process::Command::new("/usr/bin/script");
command.env_clear();
let final_command = format!("{} {}", self.command, self.args.join(" "));
command.args(vec!["-q", "-f", "session.log", "-c", &final_command]);
command.envs(self.envs);
command
}