Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Fix error when using Open With option in OSX finder #2366

Merged
merged 2 commits into from
Jun 30, 2018
Merged
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
11 changes: 9 additions & 2 deletions main/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,15 @@ app.on("open-file", (event, filePath) => {
if (activeWindow()) {
activeWindow().webContents.send("open-file", filePath)
} else if (process.platform.includes("darwin")) {
const argsToUse = [...process.argv, filePath]
createWindow(argsToUse, process.cwd())
const argsToUse = [...process.argv.slice(1), filePath]

if (app.isReady()) {
createWindow(argsToUse, process.cwd())
} else {
app.on("ready", () => {
createWindow(argsToUse, process.cwd())
})
}
}
})

Expand Down