Skip to content

Commit

Permalink
Print json
Browse files Browse the repository at this point in the history
Just quick one, this can be improved with a dedicated struct.
  • Loading branch information
Artturin committed Sep 7, 2024
1 parent 8b97059 commit b559bd8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ use std::collections::BTreeSet;
use std::io::Write;
use std::sync::atomic::{AtomicBool, Ordering};

use serde_json::json;

use crate::error::*;
use crate::flake::*;
use crate::opts::*; // TODO: how to avoid explicit import?
Expand Down Expand Up @@ -154,13 +156,14 @@ fn main() -> Result<(), OldeError> {
continue;
}
}
println!(
"repology {} {:?} | nixpkgs {:?} {:?}",
rn,
(*olv).clone().unwrap_or("<none>".to_string()),
vs,
ats
);

let outdated_package = json!({
"repology_name": rn,
"attribute": ats,
"repology_version": (*olv).clone().unwrap_or("<none>".to_string()),
"nixpkgs_version": vs,
});
println!("{}", outdated_package.to_string());
found_outdated += 1;
}

Expand Down

0 comments on commit b559bd8

Please sign in to comment.