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