Skip to content

TagSpaces is an offline, open source, document manager with tagging support

improved error handling in node-webkit improved saving ot UTF8 files

Ilian3ad66936d3df
diff --git a/data/node-webkit/node-webkit.api.js b/data/node-webkit/node-webkit.api.js
index 1fe6a2527..d30de8eb6 100644
--- a/data/node-webkit/node-webkit.api.js
+++ b/data/node-webkit/node-webkit.api.js
@@ -10,7 +10,7 @@ define(function(require, exports, module) {
var TSCORE = require("tscore");
var TSPOSTIO = require("tspostioapi");
- process.on("uncaughtException", function(err) { console.log("error: " + err); });
+ process.on("uncaughtException", function(err) { /*console.log("error: " + err);*/ });
function scanDirectory(dirPath, index) {
try {
@@ -151,17 +151,17 @@ define(function(require, exports, module) {
}
}
*/
-
+
// Handling the UTF8 support for text files
var UTF8_BOM = "\ufeff";
-
+
if(content.indexOf(UTF8_BOM) == 0) {
// already has a UTF8 bom
} else {
content = UTF8_BOM+content;
- }
+ }
- var isNewFile = !pathUtils.existsSync(filePath);
+ var isNewFile = !fs.existsSync(filePath);
fs.writeFile(filePath, content, 'utf8', function(error) {
if (error) {