Skip to content

Commit d6a5627

Browse files
luxzeitlosknownasilya
authored andcommitted
fix(commands): modify --debug to be without brk and add --debug-brk. (#431)
1 parent 7535ace commit d6a5627

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,9 @@ denali server --debug
5858
This will run the server and watch your code changes, and give you a URL to open so you can debug your app/addon
5959
using Chrome DevTools. Once you visit the URL, the app will start running. From there you can set breakpoints and
6060
call your API endpoints to trigger the breakpoints.
61+
62+
To mimic `node --inspect-brk` you can use:
63+
64+
```sh
65+
denali server --debug-brk
66+
```

commands/server.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ export default class ServerCommand extends Command {
4242
type: <any>'string'
4343
},
4444
debug: {
45-
description: 'Run in debug mode (add the --debug flag to node, launch node-inspector)',
45+
description: 'Run in debug mode (add the --inspect flag to node)',
46+
default: false,
47+
type: <any>'boolean'
48+
},
49+
debugBrk: {
50+
description: 'Run in debug mode (add the --inspect-brk flag to node)',
4651
default: false,
4752
type: <any>'boolean'
4853
},
@@ -147,9 +152,13 @@ export default class ServerCommand extends Command {
147152
protected startServer(argv: any, project: Project) {
148153
let bootstrapPath = project.isAddon ? path.join('test/dummy/index.js') : 'index.js';
149154
let args = [ bootstrapPath ];
150-
if (argv.debug) {
155+
if (argv.debugBrk) {
151156
args.unshift('--inspect-brk');
152157
}
158+
if(argv.debug) {
159+
args.unshift('--inspect');
160+
}
161+
153162
if (!fs.existsSync(bootstrapPath)) {
154163
throw new Error(`Unable to start your application: missing ${ bootstrapPath } file`);
155164
}

0 commit comments

Comments
 (0)