1
0
Fork 0

Update src/commands/cwg.ts

refactor/models
Matthew 2019-10-30 12:11:56 -04:00
parent b794f482f3
commit b7307ff2da
1 changed files with 2 additions and 2 deletions

View File

@ -135,8 +135,8 @@ export default class CWG extends Command {
}
}
try {
await fs.unlink(`/etc/nginx/sites-available/${domain.domain}`);
await fs.unlink(`/etc/nginx/sites-enabled/${domain.domain}`);
await fs.unlink(`/etc/nginx/sites-available/${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');
@ -191,8 +191,8 @@ export default class CWG extends Command {
}
return entry.save();
} catch (error) {
await fs.unlink(`/etc/nginx/sites-available/${domain}`);
await fs.unlink(`/etc/nginx/sites-enabled/${domain}`);
await fs.unlink(`/etc/nginx/sites-available/${domain}`);
await this.client.db.Domain.deleteMany({ domain });
throw error;
}