Skip to content

Commit

Permalink
Add vscode launch config to debug extension
Browse files Browse the repository at this point in the history
Signed-off-by: Yevhen Vydolob <[email protected]>
  • Loading branch information
evidolob committed Apr 13, 2023
1 parent b6c84ac commit 3a397e8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Podman-Desktop Process",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/scripts/run.mjs",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/**"
],
"sourceMaps": true,
"args": ["debug"],
"autoAttachChildProcesses": true
},
{
// Needs to start "Debug Podman-Desktop Process" first
"name": "Attach Debugger to Main Process",
"request": "attach",
"type": "node",
"port": 9223,
"sourceMaps": true,
"timeout": 30000
},
],
}

8 changes: 8 additions & 0 deletions scripts/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ async function run() {
await exec('yarn', ['watch'], {cwd: desktopPath});
}

async function debug() {
exec('yarn', ['watch'], {cwd: path.join(__dirname, '..')});
await exec('yarn', ['watch', '--extension-folder', path.join(__dirname, '..')], {cwd: desktopPath});
}

const firstArg = process.argv[2];

switch(firstArg) {
Expand All @@ -110,6 +115,9 @@ switch(firstArg) {
case 'run':
await run();
break;
case 'debug':
await debug();
break;

case 'prepare' :
default:
Expand Down

0 comments on commit 3a397e8

Please sign in to comment.