Skip to content

Commit

Permalink
fix: respawn uses incorrect (Renderer) executable when called from UI…
Browse files Browse the repository at this point in the history
… mode
  • Loading branch information
starpit committed Sep 18, 2022
1 parent c39d6a5 commit ee16c63
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/plugin-codeflare/src/controller/respawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ async function guidebookStore() {
export default async function respawnCommand(cmdline: string | string[]) {
return {
argv: [
encodeComponent(process.argv[0]),
// re: replace, in UI mode on macOS, the argv[0] points to the renderer executable
encodeComponent(
process.argv[0].replace(
/\/Frameworks\/(\w+) Helper \(Renderer\)\.app\/Contents\/MacOS\/\w+ Helper \(Renderer\)$/,
"/MacOS/$1"
)
),
encodeComponent((await headlessRoot()) + "/codeflare.min.js"),
"--",
...(typeof cmdline === "string" ? [cmdline] : cmdline),
Expand Down

0 comments on commit ee16c63

Please sign in to comment.