()
| 1656 | } |
| 1657 | |
| 1658 | fn check_for_git() -> bool { |
| 1659 | match std::env::consts::OS { |
| 1660 | "linux" | "freebsd" | "netbsd" | "openbsd" | "solaris" => { |
| 1661 | if find_executable("git").is_some() { |
| 1662 | return true; |
| 1663 | } |
| 1664 | println!( |
| 1665 | "{}", |
| 1666 | "Warning: Git is not installed. You should install git using your package manager.\n".yellow() |
| 1667 | ); |
| 1668 | } |
| 1669 | "macos" => { |
| 1670 | if find_executable("git").is_some() { |
| 1671 | return true; |
| 1672 | } |
| 1673 | println!( |
| 1674 | "{}", |
| 1675 | "Warning: Git is not installed. You can install git by invoking:\n\n\tgit --version\n".yellow() |
| 1676 | ); |
| 1677 | } |
| 1678 | "windows" => { |
| 1679 | if find_executable("git.exe").is_some() { |
| 1680 | return true; |
| 1681 | } |
| 1682 | |
| 1683 | println!("{}", "Warning: You are missing git. You should install git from here:\n\n\thttps://git-scm.com/download/win\n".yellow()); |
| 1684 | } |
| 1685 | unsupported_os => { |
| 1686 | println!("{}", format!("This OS may be unsupported: {unsupported_os}").yellow()); |
| 1687 | } |
| 1688 | } |
| 1689 | false |
| 1690 | } |
| 1691 | |
| 1692 | pub async fn exec(mut config: Config, args: &ArgMatches) -> anyhow::Result<PathBuf> { |
| 1693 | let options = InitOptions::from_args(args); |
no test coverage detected
searching dependent graphs…