Skip to content

Commit

Permalink
Fix passing custom args to hhvm process in launch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
PranayAgarwal committed May 30, 2018
1 parent 6671e13 commit af4adbd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ class HHVMDebuggerWrapper {
args.sandboxUser = os.userInfo().username;
}

// const hhvmArgs = args.hhvmArgs;
const hhvmArgs = ['--mode', 'vsdebug', String(args.script)];
const hhvmArgs = args.hhvmArgs || [];
const scriptArgs = args.script ? args.script.split(' ') : [];
const allArgs = ['--mode', 'vsdebug', ...hhvmArgs, ...scriptArgs];
const options = {
cwd: args.cwd || process.cwd(),
// FD[3] is used for communicating with the debugger extension.
Expand All @@ -187,7 +188,7 @@ class HHVMDebuggerWrapper {
env: process.env
};

const targetProcess = child_process.spawn(hhvmPath, hhvmArgs, options);
const targetProcess = child_process.spawn(hhvmPath, allArgs, options);

// Exit with the same error code the target exits with.
targetProcess.on('exit', code => process.exit(code));
Expand Down

0 comments on commit af4adbd

Please sign in to comment.