| 633 | // detect_source — manifest path |
| 634 | |
| 635 | fn write_manifest(dir: &Path, install_path: &Path, version: &str, schema_version: u32) { |
| 636 | let atomic_dir = dir.join("atomic"); |
| 637 | fs::create_dir_all(&atomic_dir).unwrap(); |
| 638 | // Use serde_json::json! rather than format!-templating: on Windows, |
| 639 | // `install_path` contains backslashes that are illegal in raw JSON |
| 640 | // string literals. Let the encoder do the escaping. |
| 641 | let manifest = serde_json::json!({ |
| 642 | "schema_version": schema_version, |
| 643 | "source": "official-installer", |
| 644 | "install_path": install_path, |
| 645 | "version": version, |
| 646 | "platform": "x86_64-unknown-linux-gnu", |
| 647 | "installed_at": "2026-05-16T00:00:00Z", |
| 648 | "installer_url": "https://atomic.storage/install.sh", |
| 649 | "artifact_url": "", |
| 650 | "artifact_sha256": "", |
| 651 | "binary_sha256": "", |
| 652 | }); |
| 653 | fs::write(atomic_dir.join("install.json"), manifest.to_string()).unwrap(); |
| 654 | } |
| 655 | |
| 656 | #[test] |
| 657 | fn detect_source_manifest_happy_path() { |