diff options
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | build.rs | 6 | ||||
| -rw-r--r-- | src/commands/general/version.rs | 3 |
3 files changed, 10 insertions, 0 deletions
@@ -5,6 +5,7 @@ edition = "2021" repository = "https://github.com/getchoo/teawieBot" license = "MIT" readme = "README.md" +build = "build.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..af1183f --- /dev/null +++ b/build.rs @@ -0,0 +1,6 @@ +fn main() { + println!( + "cargo:rustc-env=TARGET={}", + std::env::var("TARGET").unwrap() + ); +} diff --git a/src/commands/general/version.rs b/src/commands/general/version.rs index 20368f2..5acd36a 100644 --- a/src/commands/general/version.rs +++ b/src/commands/general/version.rs @@ -1,11 +1,13 @@ use crate::colors::Colors; use crate::Context; + use color_eyre::eyre::Result; /// Get version info #[poise::command(slash_command)] pub async fn version(ctx: Context<'_>) -> Result<()> { let sha = option_env!("GIT_SHA").unwrap_or("main"); + let target = option_env!("TARGET").unwrap_or("Unknown"); let revision_url = format!( "[{}]({}/tree/{})", @@ -20,6 +22,7 @@ pub async fn version(ctx: Context<'_>) -> Result<()> { option_env!("CARGO_PKG_VERSION").unwrap_or("not found"), false, ), + ("Target:", target, false), ("Revision:", &revision_url, false), ("User Agent:", &crate::api::USER_AGENT, false), ]; |
