fix watch regex and parse args (#4270)

This commit is contained in:
Jack Kavanagh
2021-12-15 12:26:44 +01:00
committed by GitHub
parent fa4cf3f7b7
commit 0abbefaf9e
2 changed files with 4 additions and 2 deletions

2
.vscode/tasks.json vendored
View File

@@ -91,7 +91,7 @@
"regexp": "watching"
},
"endsPattern": {
"regexp": "Built at\\:"
"regexp": "\\d+ modules"
}
}
},

View File

@@ -5,13 +5,15 @@
* It allows us to provide a free text prompt to the user to pass any inso extra arguments.
* https://github.com/microsoft/vscode/issues/83678
*/
const shellwords = require("shellwords");
let args = process.argv;
if (args.length >= 2 && require('inspector').url()) {
args = process.argv.reduce((allArgs, arg) => [...allArgs, ...arg.split(/\s/)], []);
args = process.argv.reduce((allArgs, arg) => [...allArgs, ...shellwords.split(arg)], []);
}
// This should always be the same as bin/inso
global.require = require;
const insomniacli = require('../dist/index.js');
insomniacli.go(args);