Skip to content

Commit

Permalink
fix(all): scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Sep 29, 2023
1 parent 8bdd74a commit 82b575f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backend/src/plugins/minecraft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ pub async fn minecraft(_req: tide::Request<State>) -> Result<tide::Response, tid
res.set_content_type("application/json");

Ok(res)
}
}
14 changes: 10 additions & 4 deletions backend/src/plugins/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::Serialize;
use crate::State;
use serde::Serialize;

mod minecraft;

Expand All @@ -11,7 +11,11 @@ struct Plugin {

static mut PLUGINS: Vec<Plugin> = vec![];

pub fn parse_enable_plugins(app: &mut tide::Server<State>, plugins: Option<String>, address: String) {
pub fn parse_enable_plugins(
app: &mut tide::Server<State>,
plugins: Option<String>,
address: String,
) {
if plugins.is_none() {
return;
}
Expand All @@ -28,7 +32,9 @@ pub fn parse_enable_plugins(app: &mut tide::Server<State>, plugins: Option<Strin
for plugin in plugins {
let endpoints = match plugin {
"minecraft" => minecraft::register(app, address.clone()),
_ => {vec![]}
_ => {
vec![]
}
};

for endpoint in endpoints {
Expand Down Expand Up @@ -57,4 +63,4 @@ async fn plugins_route(_req: tide::Request<State>) -> Result<tide::Response, tid
res.set_content_type("application/json");

Ok(res)
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "cd ./frontend && npm run build && cd ../backend && cargo run -- -u test -k test",
"build:bun": "cd ./frontend && bun run build && cd ../backend && cargo build --release",
"build": "cd ./frontend && npm run build && cd ../backend && cargo build --release",
"clippy:fix": "cd ./backend && cargo clippy --fix",
"fmt:fix": "cd ./backend && cargo fmt"
"clippy:fix": "cargo clippy --manifest-path ./backend/Cargo.toml --all --fix",
"fmt:fix": "cargo fmt --manifest-path ./backend/Cargo.toml --all"
}
}

0 comments on commit 82b575f

Please sign in to comment.