diff options
Diffstat (limited to 'services/docker/mail-server/relay/main.ts')
-rw-r--r-- | services/docker/mail-server/relay/main.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/services/docker/mail-server/relay/main.ts b/services/docker/mail-server/relay/main.ts new file mode 100644 index 0000000..7f91179 --- /dev/null +++ b/services/docker/mail-server/relay/main.ts @@ -0,0 +1,20 @@ +import { parseArgs } from "@std/cli"; + +import { AwsRelayApp } from "./aws/app.ts"; + +if (import.meta.main) { + const app = new AwsRelayApp(); + + const args = parseArgs(Deno.args); + if (args._.length === 0) { + throw new Error("You must specify a command."); + } + + const command = args._[0]; + if (command in app.cliCommands) { + await app.cliCommands[command](); + Deno.exit(0); + } else { + throw new Error(command + " is not a valid command."); + } +} |