(
&self,
source: &Path,
target: &TargetConfig,
options: &SyncOptions,
)
| 493 | } |
| 494 | |
| 495 | fn resolve_source_path( |
| 496 | &self, |
| 497 | source: &Path, |
| 498 | target: &TargetConfig, |
| 499 | options: &SyncOptions, |
| 500 | ) -> Result<ResolvedSource> { |
| 501 | if self.should_compress_agents_md(source, target) { |
| 502 | if !source.exists() { |
| 503 | return Ok(ResolvedSource { |
| 504 | path: source.to_path_buf(), |
| 505 | exists: false, |
| 506 | }); |
| 507 | } |
| 508 | |
| 509 | let compressed = compressed_agents_md_path(source); |
| 510 | |
| 511 | if !options.dry_run { |
| 512 | self.write_compressed_agents_md(source, &compressed, options)?; |
| 513 | } |
| 514 | |
| 515 | let exists = options.dry_run || compressed.exists(); |
| 516 | return Ok(ResolvedSource { |
| 517 | path: compressed, |
| 518 | exists, |
| 519 | }); |
| 520 | } |
| 521 | |
| 522 | Ok(ResolvedSource { |
| 523 | path: source.to_path_buf(), |
| 524 | exists: source.exists(), |
| 525 | }) |
| 526 | } |
| 527 | |
| 528 | fn should_compress_agents_md(&self, source: &Path, target: &TargetConfig) -> bool { |
| 529 | self.config.compress_agents_md |
no test coverage detected