mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
fixed problem with npm
This commit is contained in:
parent
6dfc5f2c88
commit
db0d0d1f72
1 changed files with 32 additions and 30 deletions
|
@ -1,19 +1,21 @@
|
|||
var startTime = new Date().getTime();
|
||||
var fs = require("fs");
|
||||
var db = require("../src/node/db/DB");
|
||||
//var async = require("../src/node_modules/async");
|
||||
|
||||
var sqlFile = process.argv[2];
|
||||
require("ep_etherpad-lite/node_modules/npm").load({}, function(er,npm) {
|
||||
|
||||
//stop if the settings file is not set
|
||||
if(!sqlFile)
|
||||
{
|
||||
console.error("Use: node importSqlIntoRedis.js $SQLFILE");
|
||||
var fs = require("fs");
|
||||
var db = require("ep_etherpad-lite/node/db/DB");;
|
||||
|
||||
var sqlFile = process.argv[2];
|
||||
|
||||
//stop if the settings file is not set
|
||||
if(!sqlFile)
|
||||
{
|
||||
console.error("Use: node importSqlFile.js $SQLFILE");
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
log("initializing db");
|
||||
db.init(function(){
|
||||
log("initializing db");
|
||||
db.init(function(){
|
||||
log("done");
|
||||
|
||||
log("open output file...");
|
||||
|
@ -36,9 +38,9 @@ db.init(function(){
|
|||
log("finished, imported " + keyNo + " keys.");
|
||||
process.exit(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function log(str)
|
||||
{
|
||||
console.log((new Date().getTime() - startTime)/1000 + "\t" + str);
|
||||
|
|
Loading…
Reference in a new issue