More bug fixes
parent
f55db08f36
commit
d6ec1d6a6c
|
@ -126,9 +126,8 @@ export default class CWG_Create extends Command {
|
||||||
|
|
||||||
return Promise.all(completed);
|
return Promise.all(completed);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
await fs.unlink(`/etc/nginx/sites-available/${args[1]}`);
|
const tasks = [fs.unlink(`/etc/nginx/sites-enabled/${args[1]}`), fs.unlink(`/etc/nginx/sites-available/${args[1]}`), this.client.db.Domain.deleteMany({ domain: args[1] })];
|
||||||
await fs.unlink(`/etc/nginx/sites-enabled/${args[1]}`);
|
await Promise.allSettled(tasks);
|
||||||
await this.client.db.Domain.deleteMany({ domain: args[1] });
|
|
||||||
return this.client.util.handleError(err, message, this);
|
return this.client.util.handleError(err, message, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,7 +181,7 @@ export default class CWG_Create extends Command {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const tasks = [fs.unlink(`/etc/nginx/sites-enabled/${domain}`), fs.unlink(`/etc/nginx/sites-available/${domain}`), this.client.db.Domain.deleteMany({ domain })];
|
const tasks = [fs.unlink(`/etc/nginx/sites-enabled/${domain}`), fs.unlink(`/etc/nginx/sites-available/${domain}`), this.client.db.Domain.deleteMany({ domain })];
|
||||||
await Promise.allSettled(tasks);
|
await Promise.allSettled(tasks);
|
||||||
return Promise.reject(error);
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue