mirror of
https://github.com/leanote/desktop-app.git
synced 2026-01-15 06:04:16 +08:00
upgrade
This commit is contained in:
11
src/node_modules/db.js
generated
vendored
11
src/node_modules/db.js
generated
vendored
@@ -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');
|
||||
Reference in New Issue
Block a user