diff --git a/app/main-process/main.js b/app/main-process/main.js index d49612c5..c1de44cd 100644 --- a/app/main-process/main.js +++ b/app/main-process/main.js @@ -267,12 +267,12 @@ app.on('ready', function () { } }); - // Windows passed file to open on command line? - if (process.platform == "win32" && process.argv.length > 1 && !pendingPathToOpen) { + // File passed to open on command line? (Windows file association, Linux .desktop %f, terminal) + if (process.platform != "darwin" && process.argv.length > 1 && !pendingPathToOpen) { for (let i = 1; i < process.argv.length; i++) { - var arg = process.argv[i].toLowerCase(); - if (arg.endsWith(".ink")) { - pendingPathToOpen = process.argv[1]; + var arg = process.argv[i]; + if (arg.toLowerCase().endsWith(".ink")) { + pendingPathToOpen = require("path").resolve(arg); break; } } diff --git a/resources/com.inkle.inky.desktop b/resources/com.inkle.inky.desktop index 75394eb6..83f09900 100755 --- a/resources/com.inkle.inky.desktop +++ b/resources/com.inkle.inky.desktop @@ -4,6 +4,6 @@ Type=Application Categories=Development;IDE; Name=Inky Comment=Inky -Exec=/opt/inky/Inky +Exec=/opt/inky/Inky %f Path=/opt/inky/ Icon=inky