use std::path::PathBuf;
pub use crate::executor::ProcessExecutor;
pub fn get_os_info() -> String {
format!("{} {}", std::env::consts::OS, std::env::consts::ARCH)
}
pub fn get_working_directory() -> std::io::Result<PathBuf> {
std::env::current_dir()
}
pub fn get_shell() -> Option<String> {
std::env::var("SHELL").ok()
}
pub fn get_arch() -> &'static str {
std::env::consts::ARCH
}
pub fn is_git_repo(executor: &dyn ProcessExecutor) -> bool {
executor
.execute("git", &["rev-parse", "--git-dir"], &[], None)
.map(|o| o.status.success())
.unwrap_or(false)
}
pub fn get_os() -> &'static str {
std::env::consts::OS
}