diff options
Diffstat (limited to 'src/cli.rs')
| -rw-r--r-- | src/cli.rs | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -101,8 +101,17 @@ pub fn run(cli: Cli) -> Result<()> { } fn load_artifact(path: &std::path::Path) -> Result<ArtifactManifest> { - match path.extension().and_then(|extension| extension.to_str()) { - Some("toml") => ArtifactManifest::load(path), - _ => ArtifactManifest::collect_archive(path), + if matches!(path.extension().and_then(|extension| extension.to_str()), Some("toml")) { + return ArtifactManifest::load(path); + } + + // A completed native build writes richer package and initramfs facts beside + // its tarball. Prefer that project-owned semantic record while retaining + // direct legacy-tar inspection when no companion is available. + let companion = ArtifactManifest::path_beside(path)?; + if companion.is_file() { + ArtifactManifest::load(companion) + } else { + ArtifactManifest::collect_archive(path) } } |