Updated init command
This commit is contained in:
parent
4b264c5da8
commit
d94aa35576
|
@ -52,7 +52,7 @@ pub fn gather_sessions(user: &User) -> Vec<Session> {
|
|||
true => gather_hm_sessions(&hm_profile),
|
||||
false => vec![Session {
|
||||
name: String::from("Shell"),
|
||||
init: user.shell.clone(),
|
||||
init: user.shell.to_str().unwrap().to_owned(),
|
||||
}],
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +105,11 @@ fn gather_session_data(path: &PathBuf) -> Session {
|
|||
let session_path = path.join("session");
|
||||
|
||||
let name = read_to_string(session_path.join("name")).unwrap();
|
||||
let init = session_path.join("init");
|
||||
let init = format!(
|
||||
"{} && {}",
|
||||
path.join("activate").display(),
|
||||
session_path.join("init").display()
|
||||
);
|
||||
|
||||
Session { name, init }
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ pub fn login(
|
|||
return Ok(LoginResult::Success);
|
||||
} else {
|
||||
starting = true;
|
||||
let cmd = vec![session.init.to_str().unwrap().to_owned()];
|
||||
let cmd = vec![session.init.clone()];
|
||||
let env = vec![];
|
||||
Request::StartSession { cmd, env }.write_to(&mut stream)?;
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ impl Display for User {
|
|||
#[derive(PartialEq, Eq, Clone)]
|
||||
struct Session {
|
||||
name: String,
|
||||
init: PathBuf,
|
||||
init: String,
|
||||
}
|
||||
|
||||
impl Display for Session {
|
||||
|
@ -325,11 +325,12 @@ impl App {
|
|||
{
|
||||
LoginResult::Success => {
|
||||
self.error = false;
|
||||
self.status = Status::Success
|
||||
self.status = Status::Success;
|
||||
self.exit = true;
|
||||
}
|
||||
LoginResult::Failure => {
|
||||
self.error = true;
|
||||
self.status = Status::Error
|
||||
self.status = Status::Error;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue