()
| 40 | } |
| 41 | |
| 42 | pub fn executable_name() -> String { |
| 43 | let name = std::env::current_exe() |
| 44 | .expect("Cannot get the path of current executable.") |
| 45 | .file_name() |
| 46 | .expect("Cannot get the executable name.") |
| 47 | .to_string_lossy() |
| 48 | .into_owned(); |
| 49 | if name.starts_with("git-") && name.len() > 4 { |
| 50 | let tmp: Vec<String> = name.split("git-").map(|x| x.to_string()).collect(); |
| 51 | let git_cmd = &tmp[1]; |
| 52 | return format!("git {}", git_cmd); |
| 53 | } |
| 54 | name |
| 55 | } |
| 56 | |
| 57 | pub fn check_gh_cli_installed() -> Result<(), git2::Error> { |
| 58 | let output = std::process::Command::new("gh").arg("--version").output(); |
no outgoing calls
no test coverage detected