Skip to content

Commit

Permalink
allow empty commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Vittorio Palmisano committed Sep 23, 2024
1 parent 99aea70 commit 1a4ec7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ async function main(): Promise<void> {

const config = loadConfig(process.argv[2])

const commands = json5.parse(config.commandConfig) as Command[]

await startThrottle(config.throttleConfig)

const stop = async (): Promise<void> => {
Expand All @@ -60,6 +58,9 @@ async function main(): Promise<void> {
}
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)
Expand Down

0 comments on commit 1a4ec7d

Please sign in to comment.