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), |         true => gather_hm_sessions(&hm_profile), | ||||||
|         false => vec![Session { |         false => vec![Session { | ||||||
|             name: String::from("Shell"), |             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 session_path = path.join("session"); | ||||||
| 
 | 
 | ||||||
|     let name = read_to_string(session_path.join("name")).unwrap(); |     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 } |     Session { name, init } | ||||||
| } | } | ||||||
|  | |||||||
| @ -30,7 +30,7 @@ pub fn login( | |||||||
|                     return Ok(LoginResult::Success); |                     return Ok(LoginResult::Success); | ||||||
|                 } else { |                 } else { | ||||||
|                     starting = true; |                     starting = true; | ||||||
|                     let cmd = vec![session.init.to_str().unwrap().to_owned()]; |                     let cmd = vec![session.init.clone()]; | ||||||
|                     let env = vec![]; |                     let env = vec![]; | ||||||
|                     Request::StartSession { cmd, env }.write_to(&mut stream)?; |                     Request::StartSession { cmd, env }.write_to(&mut stream)?; | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -111,7 +111,7 @@ impl Display for User { | |||||||
| #[derive(PartialEq, Eq, Clone)] | #[derive(PartialEq, Eq, Clone)] | ||||||
| struct Session { | struct Session { | ||||||
|     name: String, |     name: String, | ||||||
|     init: PathBuf, |     init: String, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl Display for Session { | impl Display for Session { | ||||||
| @ -325,11 +325,12 @@ impl App { | |||||||
|         { |         { | ||||||
|             LoginResult::Success => { |             LoginResult::Success => { | ||||||
|                 self.error = false; |                 self.error = false; | ||||||
|                 self.status = Status::Success |                 self.status = Status::Success; | ||||||
|  |                 self.exit = true; | ||||||
|             } |             } | ||||||
|             LoginResult::Failure => { |             LoginResult::Failure => { | ||||||
|                 self.error = true; |                 self.error = true; | ||||||
|                 self.status = Status::Error |                 self.status = Status::Error; | ||||||
|             } |             } | ||||||
|         }; |         }; | ||||||
|     } |     } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jan-Bulthuis
						Jan-Bulthuis