MCPcopy Create free account
hub / github.com/dashed/git-chain / executable_name

Function executable_name

src/main.rs:42–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42pub 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
57pub fn check_gh_cli_installed() -> Result<(), git2::Error> {
58 let output = std::process::Command::new("gh").arg("--version").output();

Callers 2

parse_arg_matchesFunction · 0.85
initMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected