-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ByteOtter
committed
Sep 6, 2024
1 parent
9ef8a11
commit b9bbd9c
Showing
6 changed files
with
5,312 additions
and
1,809 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!"); | ||
} | ||
|
Oops, something went wrong.