forked from GitHub/dbot
fixed module unloading
This commit is contained in:
parent
1f2c7fa835
commit
f72e29398f
@ -80,7 +80,8 @@ var admin = function(dbot) {
|
|||||||
'unload': function(event) {
|
'unload': function(event) {
|
||||||
var moduleName = event.params[1];
|
var moduleName = event.params[1];
|
||||||
if(dbot.moduleNames.include(moduleName)) {
|
if(dbot.moduleNames.include(moduleName)) {
|
||||||
var cacheKey = require.resolve('../modules/' + moduleName);
|
var moduleDir = '../' + moduleName + '/';
|
||||||
|
var cacheKey = require.resolve(moduleDir + moduleName);
|
||||||
delete require.cache[cacheKey];
|
delete require.cache[cacheKey];
|
||||||
|
|
||||||
var moduleIndex = dbot.moduleNames.indexOf(moduleName);
|
var moduleIndex = dbot.moduleNames.indexOf(moduleName);
|
||||||
|
Loading…
Reference in New Issue
Block a user