From ef7822ee442dc1e0fa215375ad6bd8be3fe52c1c Mon Sep 17 00:00:00 2001 From: Will Hunt <will@half-shot.uk> Date: Mon, 4 Jun 2018 08:47:25 +0100 Subject: [PATCH] Exit tool when finished --- tools/userClientTools.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/userClientTools.ts b/tools/userClientTools.ts index 0e26b49..0db1f31 100644 --- a/tools/userClientTools.ts +++ b/tools/userClientTools.ts @@ -5,6 +5,7 @@ import * as args from "command-line-args"; import * as usage from "command-line-usage"; import * as readline from "readline"; import * as Bluebird from "bluebird"; +import * as process from "process"; import {DiscordClientFactory} from "../src/clientfactory"; import { DiscordBridgeConfig } from "../src/config"; @@ -79,16 +80,20 @@ Please enter your Discord Token rl.close(); addUserToken(userid, token).then(() => { log.info("tool", "Completed successfully"); + process.exit(0); }).catch((err) => { log.info("tool", "Failed to add, $s", err); + process.exit(1); }); }); } else if (options.remove) { rl.close(); discordstore.delete_user_token(userid).then(() => { log.info("tool", "Completed successfully"); + process.exit(0); }).catch((err) => { log.info("tool", "Failed to delete, $s", err); + process.exit(1); }); } }); -- GitLab