mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
Fix #1142 error in bin/migrateDirtyDBtoMySQL.js
npm must be npm.load'ed before using it
This commit is contained in:
parent
dc3db7a4a8
commit
b057759eae
1 changed files with 13 additions and 7 deletions
|
@ -1,11 +1,17 @@
|
|||
var dirty = require("../src/node_modules/ueberDB/node_modules/dirty")('var/dirty.db');
|
||||
var db = require("../src/node/db/DB");
|
||||
require("ep_etherpad-lite/node_modules/npm").load({}, function(er,npm) {
|
||||
|
||||
db.init(function() {
|
||||
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 = db.db;
|
||||
dirty.on("load", function() {
|
||||
dirty.forEach(function(key, value) {
|
||||
db.set(key, value);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue