From 0d43ca24c8823826f5af6204311bfa3d56210d9b Mon Sep 17 00:00:00 2001 From: salty Date: Tue, 23 Jul 2024 18:04:07 +0200 Subject: [PATCH] add version to json output --- Cargo.toml | 2 +- src/main.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index accd240..8467a04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "saltbox-facts" -version = "1.0.3" +version = "1.0.4" edition = "2021" [profile.dev] diff --git a/src/main.rs b/src/main.rs index a89c69c..38924f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,6 +11,7 @@ use std::env; const TIMEOUT: u64 = 3; const GROUP_FILE_PATH: &str = "/etc/group"; const PASSWD_FILE_PATH: &str = "/etc/passwd"; +const VERSION: &str = env!("CARGO_PKG_VERSION"); #[tokio::main] async fn main() -> Result<(), Box> { @@ -39,6 +40,7 @@ async fn main() -> Result<(), Box> { let timezone_data = get_timezone()?; let result = json!({ + "saltbox_facts_version": VERSION, "ip": { "public_ip": ipv4.as_deref().unwrap_or(""), "public_ipv6": ipv6.as_deref().unwrap_or(""),