Skip to content

Commit

Permalink
Update to upstream v4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteOtter committed Sep 6, 2024
1 parent 9ef8a11 commit b9bbd9c
Show file tree
Hide file tree
Showing 6 changed files with 5,312 additions and 1,809 deletions.
55 changes: 54 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
[package]
name = "thanix_client"
version = "2.0.1"
version = "2.0.2"
authors = ["Christopher Hock <[email protected]>"]
edition = "2021"
description = "A netbox API client used as a reference for the Nazara project. Generated from the schema of https://demo.netbox.dev/"
readme = "README.md"
license = "MIT"
build = "build.rs"

[lib]
path = "src/lib.rs"

[build-dependencies]
toml = "0.8.19"

[dependencies]
serde = { version = "1.0.195", features = ["derive"] }
serde_json = "1.0.108"
Expand Down
26 changes: 26 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use std::fs::File;
use std::io::Write;
use std::path::Path;
use toml::Value;

fn main() {
let manifest_path = Path::new("Cargo.toml");

let content =
std::fs::read_to_string(manifest_path).expect("Unable to read manifest to string.");
let parsed_toml: Value = content.parse().expect("Failed to parse toml!");

let version = parsed_toml["package"]["version"]
.as_str()
.unwrap_or("0.0.0");

let version_file_path = Path::new("src").join("version.rs");
let mut file = File::create(version_file_path).expect("Unable to create version.rs!");
writeln!(
file,
"#[allow(dead_code)]\npub const VERSION: &str = \"{}\";",
version
)
.expect("Unable to write to file!");
}

Loading

0 comments on commit b9bbd9c

Please sign in to comment.