pub(crate) fn get_current_branch() -> String {
let current_branch_output = std::process::Command::new("git")
.arg("branch")
.arg("--show-current")
.output()
.expect("Failed to get current branch");
String::from_utf8_lossy(¤t_branch_output.stdout)
.trim()
.to_string()
}
pub(crate) fn ensure_glab_installed() {
if std::process::Command::new("glab")
.arg("--version")
.output()
.is_err()
{
eprintln!(
"[Error] GitLab CLI `glab` is not installed. Please install it to use this application."
);
std::process::exit(1);
}
}