From f72e29398fd49622139e195717e1e78e5e3383f1 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Tue, 11 Dec 2012 20:27:18 +0000 Subject: [PATCH] fixed module unloading --- modules/admin/admin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/admin/admin.js b/modules/admin/admin.js index 173e270..99e8a2e 100644 --- a/modules/admin/admin.js +++ b/modules/admin/admin.js @@ -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);