mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-15 15:41:19 +00:00
login, readme
This commit is contained in:
7
node_modules/db.js
generated
vendored
7
node_modules/db.js
generated
vendored
@@ -6,10 +6,11 @@ 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);
|
||||
|
||||
// test
|
||||
if(dbPath.length < 6) {
|
||||
var dbPath = '/Users/life/Library/Application Support/Leanote' + '/nedb';
|
||||
// var dbPath = '/Users/life/Library/Application Support/Leanote' + '/nedb';
|
||||
}
|
||||
|
||||
// console.log(dbPath);
|
||||
@@ -18,7 +19,9 @@ var db = {};
|
||||
var dbNames = ['notebooks', 'notes', 'users', 'tags', 'images', 'attachs', 'noteHistories', 'g'];
|
||||
for(var i in dbNames) {
|
||||
var name = dbNames[i];
|
||||
db[name] = new Datastore({ filename: path.join(dbPath, name + '.db'), autoload: true });
|
||||
var p = path.join(dbPath, name + '.db');
|
||||
console.log(p);
|
||||
db[name] = new Datastore({ filename: p, autoload: true });
|
||||
}
|
||||
module.exports = db;
|
||||
console.log('db init');
|
Reference in New Issue
Block a user