This commit is contained in:
life
2015-03-24 02:54:08 +08:00
parent 3e3b4b2924
commit e755043cb3
28 changed files with 4054 additions and 18 deletions

11
src/node_modules/db.js generated vendored
View File

@@ -5,12 +5,13 @@ var Evt = require('evt');
// 数据库初始化
// var dbPath = require('nw.gui').App.dataPath + '/nedb';
// var dbPath = Evt.getBasePath() + '/Users/life/Library/Application Support/Leanote' + '/nedb';
var dbPath = Evt.getBasePath() + '/nedb';
console.error(dbPath);
// nedb2 为了port
var dbPath = Evt.getBasePath() + '/nedb2';
// console.error(dbPath);
// test
if(dbPath.length < 6) {
var dbPath = '/Users/life/Library/Application Support/Leanote' + '/nedb';
var dbPath = '/Users/life/Library/Application Support/Leanote' + '/nedb2';
}
// console.log(dbPath);
@@ -20,8 +21,8 @@ var dbNames = ['notebooks', 'notes', 'users', 'tags', 'images', 'attachs', 'note
for(var i in dbNames) {
var name = dbNames[i];
var p = path.join(dbPath, name + '.db');
console.log(p);
// console.log(p);
db[name] = new Datastore({ filename: p, autoload: true });
}
module.exports = db;
console.log('db init');
console.log('db inited');