Create the .atomicignore file if a kind is specified.
(&self, repo_path: &Path)
| 433 | |
| 434 | /// Create the .atomicignore file if a kind is specified. |
| 435 | fn create_ignore_file(&self, repo_path: &Path) -> CliResult<bool> { |
| 436 | let Some(kind) = &self.kind else { |
| 437 | return Ok(false); |
| 438 | }; |
| 439 | |
| 440 | let Some(template) = get_ignore_template(kind) else { |
| 441 | // Unknown kind - warn but don't fail |
| 442 | print_hint(&format!( |
| 443 | "Unknown project kind '{}'. Supported kinds: {}", |
| 444 | kind, |
| 445 | supported_kinds().join(", ") |
| 446 | )); |
| 447 | return Ok(false); |
| 448 | }; |
| 449 | |
| 450 | let ignore_path = repo_path.join(".atomicignore"); |
| 451 | |
| 452 | // Don't overwrite existing ignore file |
| 453 | if ignore_path.exists() { |
| 454 | print_hint(".atomicignore already exists, skipping"); |
| 455 | return Ok(false); |
| 456 | } |
| 457 | |
| 458 | std::fs::write(&ignore_path, template).map_err(CliError::Io)?; |
| 459 | |
| 460 | Ok(true) |
| 461 | } |
| 462 | |
| 463 | /// Validate the view name. |
| 464 | fn validate_view_name(&self) -> CliResult<()> { |
nothing calls this directly
no test coverage detected