From e6cc5242f4615e362798c9ba67600c116c6993f9 Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Sun, 8 Dec 2013 09:14:05 -0800 Subject: [PATCH] Fixed EXDEV issue in NW apps --- lib/datastore.js | 2 +- lib/persistence.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/datastore.js b/lib/datastore.js index 8e432a8..886e7e5 100644 --- a/lib/datastore.js +++ b/lib/datastore.js @@ -560,6 +560,6 @@ Datastore.prototype._remove = function (query, options, cb) { Datastore.prototype.remove = function () { this.executor.push({ this: this, fn: this._remove, arguments: arguments }); }; - + module.exports = Datastore; \ No newline at end of file diff --git a/lib/persistence.js b/lib/persistence.js index 4f28f9d..a7fe72d 100644 --- a/lib/persistence.js +++ b/lib/persistence.js @@ -37,7 +37,16 @@ function Persistence (options) { // For NW apps, store data in the same directory where NW stores application data if (this.filename && options.nodeWebkitAppName) { + console.log("=================================================================="); + console.log("WARNING: The nodeWebkitAppName option is deprecated"); + console.log("To get the path to the directory where Node Webkit stores the data"); + console.log("for your app, use the internal nw.gui module like this"); + console.log("require('nw.gui').App.dataPath"); + console.log("See https://github.com/rogerwang/node-webkit/issues/500"); + console.log("=================================================================="); this.filename = Persistence.getNWAppFilename(options.nodeWebkitAppName, this.filename); + this.tempFilename = Persistence.getNWAppFilename(options.nodeWebkitAppName, this.tempFilename); + this.oldFilename = Persistence.getNWAppFilename(options.nodeWebkitAppName, this.oldFilename); } };