summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-12-15 16:06:59 -0500
committerseth <[email protected]>2023-12-15 16:41:13 -0500
commitb520f45fd3ef855cb0b3ff23603fd5d30aa27296 (patch)
tree102747965571a56bf986d9d40651461584b88cbf
parente78f09012cef68cbbde8ace7d95d3c5dd5645a67 (diff)
commands: add rust target to version
-rw-r--r--Cargo.toml1
-rw-r--r--build.rs6
-rw-r--r--src/commands/general/version.rs3
3 files changed, 10 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 62fec73..35e50b4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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),
];