TagSpaces is an offline, open source, document manager with tagging support
fixing issue with opening files from command line fixing issue with start in portable mode
uggrockb215edbf40e6
diff --git a/data/node-webkit/node-webkit.api.js b/data/node-webkit/node-webkit.api.jsindex b714afd9c..1e1c9ddca 100644--- a/data/node-webkit/node-webkit.api.js+++ b/data/node-webkit/node-webkit.api.js@@ -92,11 +92,11 @@ define(function(require, exports, module) {// TSCORE.FileOpener.openFile(cmdArguments);//});var cmdArguments = gui.App.argv;- if (cmdArguments !== undefined && cmdArguments.length > 0) {- console.log("CMD Arguments: " + cmdArguments + " Process running in " + process.cwd());+ if (cmdArguments && cmdArguments.length > 0) {+ console.log("CMD Arguments: " + cmdArguments[0] + " Process running in " + process.cwd());var dataPathIndex;cmdArguments.forEach(function(part, index) {- if (part === "--data-path") {+ if (part.indexOf("--data-path") === 0) {dataPathIndex = index;}});@@ -105,9 +105,11 @@ define(function(require, exports, module) {}console.log("CMD Arguments cleaned: " + cmdArguments);var filePath = "" + cmdArguments;- var dirPath = TSCORE.TagUtils.extractContainingDirectoryPath(filePath);- TSCORE.IO.listDirectory(dirPath);- TSCORE.FileOpener.openFileOnStartup(filePath);+ if(filePath.length > 1 ) {+ var dirPath = TSCORE.TagUtils.extractContainingDirectoryPath(filePath);+ TSCORE.IO.listDirectory(dirPath);+ TSCORE.FileOpener.openFileOnStartup(filePath);+ }}};diff --git a/data/node-webkit/tagspacesp b/data/node-webkit/tagspacespindex d9c8387c7..c91df19b7 100644--- a/data/node-webkit/tagspacesp+++ b/data/node-webkit/tagspacesp@@ -1,2 +1,2 @@#!/bin/bash-./tagspaces --data-path . &\ No newline at end of file+./tagspaces --data-path=data &\ No newline at end of filediff --git a/data/node-webkit/tagspacesp.cmd b/data/node-webkit/tagspacesp.cmdindex 65dced888..7863441ac 100644--- a/data/node-webkit/tagspacesp.cmd+++ b/data/node-webkit/tagspacesp.cmd@@ -1 +1 @@-start /B tagspaces.exe --data-path "."\ No newline at end of file+start /B tagspaces.exe --data-path=data\ No newline at end of file