Only refresh mods if delete is successful

This commit is contained in:
Björn Dahlgren 2015-07-22 19:20:05 +00:00
parent 9599eac5f1
commit 3656b173c9

View File

@ -28,8 +28,11 @@ Mods.prototype = new events.EventEmitter();
Mods.prototype.delete = function (mod, cb) {
var self = this;
fs.rmrf(path.join(this.config.path, mod), function (err) {
self.updateMods();
cb(err);
if (!err) {
self.updateMods();
}
});
};