Fix #1142 error in bin/migrateDirtyDBtoMySQL.js

npm must be npm.load'ed before using it
pull/1150/head
Marcel Klehr 2012-11-09 22:06:26 +01:00
parent dc3db7a4a8
commit b057759eae
1 changed files with 13 additions and 7 deletions

View File

@ -1,5 +1,9 @@
var dirty = require("../src/node_modules/ueberDB/node_modules/dirty")('var/dirty.db'); require("ep_etherpad-lite/node_modules/npm").load({}, function(er,npm) {
var db = require("../src/node/db/DB");
process.chdir(npm.root+'/..')
var dirty = require("ep_etherpad-lite/node_modules/ueberDB/node_modules/dirty")('var/dirty.db');
var db = require("ep_etherpad-lite/node/db/DB");
db.init(function() { db.init(function() {
db = db.db; db = db.db;
@ -9,3 +13,5 @@ db.init(function() {
}); });
}); });
}); });
});