(project_path: &Path)
| 1872 | } |
| 1873 | |
| 1874 | pub fn init_cpp_project(project_path: &Path) -> anyhow::Result<()> { |
| 1875 | let export_files = vec![ |
| 1876 | ( |
| 1877 | include_str!("../../../../templates/basic-cpp/spacetimedb/CMakeLists.txt"), |
| 1878 | "CMakeLists.txt", |
| 1879 | ), |
| 1880 | ( |
| 1881 | include_str!("../../../../templates/basic-cpp/spacetimedb/src/lib.cpp"), |
| 1882 | "src/lib.cpp", |
| 1883 | ), |
| 1884 | ( |
| 1885 | include_str!("../../../../templates/basic-cpp/spacetimedb/.gitignore"), |
| 1886 | ".gitignore", |
| 1887 | ), |
| 1888 | ]; |
| 1889 | |
| 1890 | for data_file in export_files { |
| 1891 | let path = project_path.join(data_file.1); |
| 1892 | create_directory(path.parent().unwrap())?; |
| 1893 | std::fs::write(path, data_file.0)?; |
| 1894 | } |
| 1895 | |
| 1896 | check_for_emscripten_and_cmake(); |
| 1897 | check_for_git(); |
| 1898 | |
| 1899 | Ok(()) |
| 1900 | } |
| 1901 | |
| 1902 | pub async fn exec_init_rust(args: &ArgMatches) -> anyhow::Result<()> { |
| 1903 | let project_path = args.get_one::<PathBuf>("project-path").unwrap(); |
no test coverage detected
searching dependent graphs…