Skip to content

Commit c704d33

Browse files
committed
watch: get flags from execArgv
1 parent 9a237cd commit c704d33

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

lib/internal/main/watch_mode.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const {
1818
triggerUncaughtException,
1919
exitCodes: { kNoFailure },
2020
} = internalBinding('errors');
21-
const { getOptionValue, getOptionsAsFlagsFromBinding } = require('internal/options');
21+
const { getOptionValue } = require('internal/options');
2222
const { FilesWatcher } = require('internal/watch_mode/files_watcher');
2323
const { green, blue, red, white, clear } = require('internal/util/colors');
2424
const { convertToValidSignal } = require('internal/util');
@@ -44,14 +44,13 @@ const kCommand = ArrayPrototypeSlice(process.argv, 1);
4444
const kCommandStr = inspect(ArrayPrototypeJoin(kCommand, ' '));
4545

4646
const argsWithoutWatchOptions = [];
47-
const argsFromBinding = getOptionsAsFlagsFromBinding();
48-
for (let i = 0; i < argsFromBinding.length; i++) {
49-
const arg = argsFromBinding[i];
47+
for (let i = 0; i < process.execArgv.length; i++) {
48+
const arg = process.execArgv[i];
5049
if (StringPrototypeStartsWith(arg, '--watch=')) {
5150
continue;
5251
}
5352
if (arg === '--watch') {
54-
const nextArg = argsFromBinding[i + 1];
53+
const nextArg = process.execArgv[i + 1];
5554
if (nextArg && nextArg[0] !== '-') {
5655
// If `--watch` doesn't include `=` and the next
5756
// argument is not a flag then it is interpreted as

0 commit comments

Comments
 (0)