Skip to content

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

adding debug mode for electron

uggrock1cf208b784ea
diff --git a/data/electron/main.js b/data/electron/main.js
index 2cd264846..8fb8d029b 100644
--- a/data/electron/main.js
+++ b/data/electron/main.js
@@ -8,6 +8,14 @@ const BrowserWindow = electron.BrowserWindow; // Module to create native browse
//console.log("CM Args: " + JSON.stringify(process.argv));
+var debugMode;
+process.argv.forEach(function(arg) {
+ if (arg.indexOf('-d') >= 0) {
+ debugMode = true;
+ }
+});
+
+
var path = require('path');
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
@@ -38,7 +46,9 @@ app.on('ready', function() {
mainWindow.loadURL(indexPath);
// Open the DevTools.
- //mainWindow.webContents.openDevTools();
+ if(debugMode) {
+ mainWindow.webContents.openDevTools();
+ }
// Emitted when the window is closed.
mainWindow.on('closed', function() {
diff --git a/data/electron/package.tmpl.json b/data/electron/package.tmpl.json
index 8f323674d..174651855 100644
--- a/data/electron/package.tmpl.json
+++ b/data/electron/package.tmpl.json
@@ -5,5 +5,9 @@
"main": "electron/main.js",
"dependencies": {
"fs-extra": "~0.24.0"
+ },
+ "scripts": {
+ "start": "electron .",
+ "test": "electron . -d"
}
}
\ No newline at end of file
diff --git a/data/package.json b/data/package.json
index edc61a099..b7f9c1e38 100644
--- a/data/package.json
+++ b/data/package.json
@@ -5,5 +5,9 @@
"main": "electron/main.js",
"dependencies": {
"fs-extra": "~0.24.0"
+ },
+ "scripts": {
+ "start": "electron .",
+ "test": "electron . -d"
}
}
\ No newline at end of file