Skip to content

Commit

Permalink
add version to json output
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Jul 23, 2024
1 parent 295b3b0 commit 0d43ca2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "saltbox-facts"
version = "1.0.3"
version = "1.0.4"
edition = "2021"

[profile.dev]
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn std::error::Error>> {
Expand Down Expand Up @@ -39,6 +40,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
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(""),
Expand Down

0 comments on commit 0d43ca2

Please sign in to comment.