8000 Open .ink file passed on the command line on Linux by Sal3k · Pull Request #561 · inkle/inky · GitHub
[go: up one dir, main page]

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/main-process/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion resources/com.inkle.inky.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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
0