Skip to content
Extraits de code Groupes Projets
Valider ef7822ee rédigé par Will Hunt's avatar Will Hunt
Parcourir les fichiers

Exit tool when finished

parent 1671691b
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -5,6 +5,7 @@ import * as args from "command-line-args"; ...@@ -5,6 +5,7 @@ import * as args from "command-line-args";
import * as usage from "command-line-usage"; import * as usage from "command-line-usage";
import * as readline from "readline"; import * as readline from "readline";
import * as Bluebird from "bluebird"; import * as Bluebird from "bluebird";
import * as process from "process";
import {DiscordClientFactory} from "../src/clientfactory"; import {DiscordClientFactory} from "../src/clientfactory";
import { DiscordBridgeConfig } from "../src/config"; import { DiscordBridgeConfig } from "../src/config";
...@@ -79,16 +80,20 @@ Please enter your Discord Token ...@@ -79,16 +80,20 @@ Please enter your Discord Token
rl.close(); rl.close();
addUserToken(userid, token).then(() => { addUserToken(userid, token).then(() => {
log.info("tool", "Completed successfully"); log.info("tool", "Completed successfully");
process.exit(0);
}).catch((err) => { }).catch((err) => {
log.info("tool", "Failed to add, $s", err); log.info("tool", "Failed to add, $s", err);
process.exit(1);
}); });
}); });
} else if (options.remove) { } else if (options.remove) {
rl.close(); rl.close();
discordstore.delete_user_token(userid).then(() => { discordstore.delete_user_token(userid).then(() => {
log.info("tool", "Completed successfully"); log.info("tool", "Completed successfully");
process.exit(0);
}).catch((err) => { }).catch((err) => {
log.info("tool", "Failed to delete, $s", err); log.info("tool", "Failed to delete, $s", err);
process.exit(1);
}); });
} }
}); });
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter