From 786a14d126b864ead7b9bfd0c854e2a8633aded9 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Tue, 29 Oct 2019 20:27:36 -0400 Subject: [PATCH] rm on failure --- src/commands/cwg.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands/cwg.ts b/src/commands/cwg.ts index 2a6ba8b..f595cab 100644 --- a/src/commands/cwg.ts +++ b/src/commands/cwg.ts @@ -84,6 +84,9 @@ export default class CWG extends Command { } } catch (err) { this.client.util.handleError(err, message, this); + await fs.unlink(`/etc/nginx/sites-available/${args[2]}`); + await fs.unlink(`/etc/nginx/sites-enabled/${args[2]}`); + await this.client.db.Domain.deleteMany({ domain: args[2] }); } } else if (args[0] === 'data') { if (!args[1]) return this.client.commands.get('help').run(message, [this.name]);