Updated command piping to allow for interactive shell

This commit is contained in:
Jan-Bulthuis 2025-02-22 06:05:06 +01:00
parent c11fc482ef
commit 9a22c117b5
1 changed files with 3 additions and 6 deletions

View File

@ -12,14 +12,12 @@ pub fn handle_session() -> io::Result<()> {
println!(">>> Activating environment <<<");
let generation = env::var("NIXGREETY_GENERATION").unwrap();
Command::new(format!("{}/activate", generation))
.stdout(Stdio::inherit())
.output()
.status()
.expect("Failed to activate environment");
println!(">>> Creating session <<<");
Command::new(format!("{}/session/init", generation))
.stdout(Stdio::inherit())
.output()
.status()
.expect("Failed to create session");
println!(">>> Deactivating environment <<<");
@ -48,8 +46,7 @@ pub fn handle_session() -> io::Result<()> {
.map(|entry| entry.path())
.unwrap_or(PathBuf::from(""));
Command::new(format!("{}/activate", generation.display()))
.stdout(Stdio::inherit())
.output()
.status()
.unwrap();
Ok(())