mirror of
https://github.com/reality/dbot.git
synced 2024-12-25 04:02:39 +01:00
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