From 833b5fbcfaec3ae649bc95987aae3d54b8a5650d Mon Sep 17 00:00:00 2001 From: DecDuck Date: Wed, 14 Jan 2026 15:10:48 +1100 Subject: [PATCH] Auto-run torrential in development (#313) * Auto-run torrential in development * fix: lint --- .../internal/services/services/torrential.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/server/internal/services/services/torrential.ts b/server/internal/services/services/torrential.ts index 023ea99..9154336 100644 --- a/server/internal/services/services/torrential.ts +++ b/server/internal/services/services/torrential.ts @@ -13,7 +13,23 @@ export const TORRENTIAL_SERVICE = new Service( "torrential", () => { const localDir = fs.readdirSync("."); - if ("torrential" in localDir) return spawn("./torrential", [], {}); + if ("torrential" in localDir) { + const stat = fs.statSync("./torrential"); + if (stat.isDirectory()) { + // in dev and we have the submodule + logger.info( + "torrential detected in development mode - building from source", + ); + return spawn( + "cargo run --manifest-path ./torrential/Cargo.toml", + [], + {}, + ); + } else { + // binary + return spawn("./torrential", [], {}); + } + } const envPath = process.env.TORRENTIAL_PATH; if (envPath) return spawn(envPath, [], {});