(config: &TemplateConfig, project_path: &Path, is_server_only: bool)
| 1459 | } |
| 1460 | |
| 1461 | fn init_github_template(config: &TemplateConfig, project_path: &Path, is_server_only: bool) -> anyhow::Result<()> { |
| 1462 | let repo = config.github_repo.as_ref().unwrap(); |
| 1463 | clone_github_template(repo, project_path, is_server_only)?; |
| 1464 | |
| 1465 | let package_path = project_path.join("package.json"); |
| 1466 | if package_path.exists() { |
| 1467 | let content = fs::read_to_string(&package_path)?; |
| 1468 | let mut package: serde_json::Value = serde_json::from_str(&content)?; |
| 1469 | package["name"] = json!(config.project_name.clone()); |
| 1470 | let updated_content = serde_json::to_string_pretty(&package)?; |
| 1471 | fs::write(package_path, updated_content)?; |
| 1472 | } |
| 1473 | |
| 1474 | println!("{}", "Note: Custom templates require manual configuration.".yellow()); |
| 1475 | |
| 1476 | Ok(()) |
| 1477 | } |
| 1478 | |
| 1479 | fn init_empty(config: &TemplateConfig, project_path: &Path) -> anyhow::Result<()> { |
| 1480 | match config.server_lang { |
no test coverage detected
searching dependent graphs…