simplied the valid option check to pure regex
This commit is contained in:
parent
269d544ab3
commit
6e444aaf65
|
@ -276,7 +276,7 @@ class Cmd {
|
|||
.action(function(file, options) {
|
||||
const node = options.node || 'vm';
|
||||
const urlRegexExp = /^(vm|embark|((ws|https?):\/\/([a-zA-Z0-9_.-]*):?([0-9]*)?))$/i;
|
||||
if (!(node === 'embark' || node === 'vm' || node.match(urlRegexExp))) {
|
||||
if (!urlRegexExp.test(node)) {
|
||||
console.error(`invalid --node option: must be 'vm', 'embark' or a valid URL`.red);
|
||||
options.outputHelp();
|
||||
process.exit(1);
|
||||
|
|
Loading…
Reference in New Issue