mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 19:52:36 +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) {
|
||||
var moduleName = event.params[1];
|
||||
if(dbot.moduleNames.include(moduleName)) {
|
||||
var cacheKey = require.resolve('../modules/' + moduleName);
|
||||
var moduleDir = '../' + moduleName + '/';
|
||||
var cacheKey = require.resolve(moduleDir + moduleName);
|
||||
delete require.cache[cacheKey];
|
||||
|
||||
var moduleIndex = dbot.moduleNames.indexOf(moduleName);
|
||||
|
Loading…
Reference in New Issue
Block a user