use once_cell::sync::Lazy;
use std::sync::{Arc, Mutex};
use log::trace;
use miette::Result;
use pipelight_error::PipelightError;
use std::env;
pub static SHELL: Lazy<Arc<Mutex<String>>> = Lazy::new(|| Arc::new(Mutex::new("sh".to_owned())));
pub static OUTDIR: Lazy<Arc<Mutex<String>>> =
Lazy::new(|| Arc::new(Mutex::new(".pipelight/proc".to_owned())));
pub fn get_shell() -> Result<(), std::io::Error> {
trace!("Get shell");
let user_shell = env::var("SHELL");
match user_shell {
Ok(res) => {
*SHELL.lock().unwrap() = res.to_owned();
}
Err(_) => {}
}
Ok(())
}