Skip to content

Commit 331c0dd

Browse files
chore(deps): update
1 parent 33dc4fe commit 331c0dd

File tree

9 files changed

+2287
-2190
lines changed

9 files changed

+2287
-2190
lines changed

bin/cli-flags.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ module.exports = {
299299
delete opts.clientOverlay;
300300
},
301301
},
302-
// TODO remove in the next major release in favor `--open-target`
303302
{
304303
name: 'open',
305304
type: [Boolean, String],
@@ -327,7 +326,7 @@ module.exports = {
327326
description: 'Open specified browser.',
328327
processor(opts) {
329328
opts.open = opts.open || {};
330-
opts.open.app = opts.openApp.split(' ');
329+
opts.open.app = opts.openApp;
331330
delete opts.openApp;
332331
},
333332
},

lib/options.json

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,33 @@
9595
"app": {
9696
"anyOf": [
9797
{
98-
"type": "array",
99-
"items": {
100-
"type": "string",
101-
"minLength": 1
102-
},
103-
"minItems": 1
98+
"type": "object",
99+
"additionalProperties": false,
100+
"properties": {
101+
"name": {
102+
"anyOf": [
103+
{
104+
"type": "array",
105+
"items": {
106+
"type": "string",
107+
"minLength": 1
108+
},
109+
"minItems": 1
110+
},
111+
{
112+
"type": "string",
113+
"minLength": 1
114+
}
115+
]
116+
},
117+
"arguments": {
118+
"items": {
119+
"type": "string",
120+
"minLength": 1
121+
},
122+
"minItems": 1
123+
}
124+
}
104125
},
105126
{
106127
"type": "string",

lib/utils/runOpen.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ function runOpen(uri, options, logger) {
2929
const openOptions = defaultOpenOptions;
3030

3131
if (item.app) {
32-
openOptions.app = item.app;
32+
if (typeof item.app === 'string') {
33+
openOptions.app = { name: item.app };
34+
} else {
35+
openOptions.app = item.app;
36+
}
3337
}
3438

3539
return { target, options: openOptions };
@@ -65,13 +69,13 @@ function runOpen(uri, options, logger) {
6569
`Unable to open "${openTarget}" page${
6670
// eslint-disable-next-line no-nested-ternary
6771
openTask.options.app
68-
? Array.isArray(openTask.options.app)
69-
? ` in "${
70-
openTask.options.app[0]
71-
}" app with "${openTask.options.app
72-
.slice(1)
73-
.join(' ')}" arguments`
74-
: ` in "${openTask.options.app}" app`
72+
? ` in "${openTask.options.app.name}" app${
73+
openTask.options.app.arguments
74+
? ` with "${openTask.options.app.arguments.join(
75+
' '
76+
)}" arguments`
77+
: ''
78+
}`
7579
: ''
7680
}. If you are running in a headless environment, please do not use the "open" option or related flags like "--open", "--open-target", and "--open-app".`
7781
);

0 commit comments

Comments
 (0)