Browse Source

Fixed vscode debugging code

Fixes app.getPath("userData") pointing to the wrong folder. (electron in %appdata%)

The old debugger essentially runs:
.\node_modules\.bin\electron main.js

Which makes userData incorrect and various other things wrong related to app launch.

The new version correctly executes:
.\node_modules\.bin\electron .

Which means when you call app.getPath("userData") it will return the correct folder name, and not 'electron', which is what my app was doing even though the folder was named properly.
Gordon MacPherson 8 years ago
parent
commit
9b4fef3c38
1 changed files with 4 additions and 1 deletions
  1. 4 1
      docs/tutorial/debugging-main-process-vscode.md

+ 4 - 1
docs/tutorial/debugging-main-process-vscode.md

@@ -19,7 +19,10 @@ $ code electron-quick-start
       "request": "launch",
       "cwd": "${workspaceRoot}",
       "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
-      "program": "${workspaceRoot}/main.js"
+      "windows": {
+        "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
+      },
+      "args" : ["."]
     }
   ]
 }