From 1a4ec7d04d289cb9aacda40b31699b6b110a6a34 Mon Sep 17 00:00:00 2001 From: Vittorio Palmisano Date: Mon, 23 Sep 2024 18:23:39 +0200 Subject: [PATCH] allow empty commands --- src/app.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app.ts b/src/app.ts index 7f808d7..a5fcb89 100644 --- a/src/app.ts +++ b/src/app.ts @@ -49,8 +49,6 @@ async function main(): Promise { const config = loadConfig(process.argv[2]) - const commands = json5.parse(config.commandConfig) as Command[] - await startThrottle(config.throttleConfig) const stop = async (): Promise => { @@ -60,6 +58,9 @@ async function main(): Promise { } registerExitHandler(() => stop()) + const commands = config.commandConfig + ? (json5.parse(config.commandConfig) as Command[]) + : [] for (const c of commands) { const { session, command } = c const index = getSessionThrottleIndex(session || 0)