From 2b94298e8cc8875dfa5f9deda09d335a170e4533 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 23 Feb 2023 21:07:17 -0500 Subject: [PATCH] Rename backend binary and shorten V_INFO --- backend/Cargo.lock | 2 +- backend/Cargo.toml | 2 +- backend/build-docker.sh | 2 +- backend/build.sh | 6 +++--- backend/src/main.rs | 8 +++++++- src/index.tsx | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 682bc22..ab9ac0a 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -825,7 +825,7 @@ dependencies = [ ] [[package]] -name = "powertools-rs" +name = "powertools" version = "1.2.0-beta2" dependencies = [ "async-trait", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index e9ed6f1..d202c32 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "powertools-rs" +name = "powertools" version = "1.2.0-beta2" edition = "2021" authors = ["NGnius (Graham) "] diff --git a/backend/build-docker.sh b/backend/build-docker.sh index 58ae2f9..6871fb8 100755 --- a/backend/build-docker.sh +++ b/backend/build-docker.sh @@ -8,7 +8,7 @@ cargo --version echo "--- Building plugin backend ---" cargo build --profile docker mkdir -p out -cp target/release/powertools-rs out/backend +cp target/release/powertools out/backend echo " --- Cleaning up ---" # remove root-owned target folder diff --git a/backend/build.sh b/backend/build.sh index 94cd216..3a20ec7 100755 --- a/backend/build.sh +++ b/backend/build.sh @@ -5,6 +5,6 @@ cargo build --target x86_64-unknown-linux-musl #cross build --release mkdir -p ../bin -#cp ./target/x86_64-unknown-linux-musl/release/powertools-rs ../bin/backend -cp ./target/x86_64-unknown-linux-musl/debug/powertools-rs ../bin/backend -#cp ./target/release/powertools-rs ../bin/backend +#cp ./target/x86_64-unknown-linux-musl/release/powertools ../bin/backend +cp ./target/x86_64-unknown-linux-musl/debug/powertools ../bin/backend +#cp ./target/release/powertools ../bin/backend diff --git a/backend/src/main.rs b/backend/src/main.rs index ab70cbc..0971965 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -73,7 +73,13 @@ fn main() -> Result<(), ()> { let instance = Instance::new(PORT) .register("V_INFO", |_: Vec| { - vec![format!("{} v{}", PACKAGE_NAME, PACKAGE_VERSION).into()] + #[cfg(debug_assertions)] + {vec![format!("v{}-dbg", PACKAGE_VERSION).into()]} + #[cfg(not(debug_assertions))] + {vec![format!("v{}-rls", PACKAGE_VERSION).into()]} + }) + .register("NAME", |_: Vec| { + vec![PACKAGE_NAME.into()] }) .register("LOG", api::general::log_it()) // battery API functions diff --git a/src/index.tsx b/src/index.tsx index a7ab4d0..03e8d4d 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -290,7 +290,7 @@ const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => { export default definePlugin((serverApi: ServerAPI) => { return { - title:
PowerTools 300
, + title:
I'm a tool
, content: , icon: , onDismount() {