Create the .atomicignore file if a kind is specified.
(&self, repo_path: &Path)
| 415 | |
| 416 | /// Create the .atomicignore file if a kind is specified. |
| 417 | fn create_ignore_file(&self, repo_path: &Path) -> CliResult<bool> { |
| 418 | let Some(kind) = &self.kind else { |
| 419 | return Ok(false); |
| 420 | }; |
| 421 | |
| 422 | let Some(template) = get_ignore_template(kind) else { |
| 423 | // Unknown kind - warn but don't fail |
| 424 | print_hint(&format!( |
| 425 | "Unknown project kind '{}'. Supported kinds: {}", |
| 426 | kind, |
| 427 | supported_kinds().join(", ") |
| 428 | )); |
| 429 | return Ok(false); |
| 430 | }; |
| 431 | |
| 432 | let ignore_path = repo_path.join(".atomicignore"); |
| 433 | |
| 434 | // Don't overwrite existing ignore file |
| 435 | if ignore_path.exists() { |
| 436 | print_hint(".atomicignore already exists, skipping"); |
| 437 | return Ok(false); |
| 438 | } |
| 439 | |
| 440 | std::fs::write(&ignore_path, template).map_err(CliError::Io)?; |
| 441 | |
| 442 | Ok(true) |
| 443 | } |
| 444 | |
| 445 | /// Validate the view name. |
| 446 | fn validate_view_name(&self) -> CliResult<()> { |
nothing calls this directly
no test coverage detected