MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / check_for_git

Function check_for_git

crates/cli/src/subcommands/init.rs:1658–1690  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1656}
1657
1658fn 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
1692pub async fn exec(mut config: Config, args: &ArgMatches) -> anyhow::Result<PathBuf> {
1693 let options = InitOptions::from_args(args);

Callers 4

init_rust_projectFunction · 0.85
init_csharp_projectFunction · 0.85
init_typescript_projectFunction · 0.85
init_cpp_projectFunction · 0.85

Calls 1

find_executableFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…