From b794f482f37a1139ca25f1230b01d5489611f050 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 30 Oct 2019 11:56:38 -0400 Subject: [PATCH] Update src/commands/cwg.ts --- src/commands/cwg.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/cwg.ts b/src/commands/cwg.ts index bfc5e89..0d0d8a9 100644 --- a/src/commands/cwg.ts +++ b/src/commands/cwg.ts @@ -134,8 +134,10 @@ export default class CWG extends Command { }); } } - await fs.unlink(`/etc/nginx/sites-available/${domain.domain}`); - await fs.unlink(`/etc/nginx/sites-enabled/${domain.domain}`); + try { + await fs.unlink(`/etc/nginx/sites-available/${domain.domain}`); + await fs.unlink(`/etc/nginx/sites-enabled/${domain.domain}`); + } catch (e) { this.client.signale.error(e); } await this.client.db.Domain.deleteOne({ domain: domain.domain }); await this.client.util.exec('systemctl reload nginx'); edit.edit(`***${this.client.stores.emojis.success} Domain ${domain.domain} with port ${domain.port} has been successfully deleted.***`);