From a0dbbbe15b8336f6023d3d77ef68d42b25f31e82 Mon Sep 17 00:00:00 2001 From: Bsian Date: Sat, 16 Nov 2019 22:53:35 +0000 Subject: [PATCH] Fix the flipping endswith --- src/commands/securesign_init.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/securesign_init.ts b/src/commands/securesign_init.ts index bd4946d..88c8341 100644 --- a/src/commands/securesign_init.ts +++ b/src/commands/securesign_init.ts @@ -46,7 +46,7 @@ export default class SecureSign_Init extends Command { return msg.edit(`${this.client.stores.emojis.error} ***Credentials incorrect***`); } const init = await this.client.util.exec(`sudo -H -u ${account.username} bash -c 'securesign-canary init -a ${args[0]}'`); - if (!init.endsWith('Initialization sequence completed.')) throw new Error(`Account initialization did not complete successfully:\n${init}`); + if (!init.replace(/^\s+|\s+$/g, '').endsWith('Initialization sequence completed.')) throw new Error(`Account initialization did not complete successfully:\n${init}`); return msg.edit(`${this.client.stores.emojis.success} ***Account initialized***`); } catch (error) { return this.client.util.handleError(error, message, this);