Skip to content

Commit bd692e1

Browse files
committed
Fix passing multiple —header flags
Closes #43
1 parent e9b5a7a commit bd692e1

File tree

5 files changed

+4
-5
lines changed

5 files changed

+4
-5
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
node-version:
1313
- 18
1414
- 16
15-
- 14
1615
steps:
1716
- uses: actions/checkout@v3
1817
- uses: actions/setup-node@v3

cli.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import process from 'node:process';
33
import meow from 'meow';
44
import captureWebsite from 'capture-website';
5-
import arrify from 'arrify';
65
import splitOnFirst from 'split-on-first';
76
import getStdin from 'get-stdin';
87

@@ -166,6 +165,7 @@ const cli = meow(`
166165
},
167166
header: {
168167
type: 'string',
168+
isMultiple: true,
169169
},
170170
userAgent: {
171171
type: 'string',
@@ -222,11 +222,13 @@ if (options.clip) {
222222
}
223223

224224
options.headers = {};
225-
for (const header of arrify(options.header)) {
225+
for (const header of options.header) {
226226
const [key, value] = header.split(':');
227227
options.headers[key.trim()] = value.trim();
228228
}
229229

230+
delete options.header;
231+
230232
if (options.authentication) {
231233
const [username, password] = splitOnFirst(options.authentication, ':');
232234
options.authentication = {username, password};

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"jpg"
4242
],
4343
"dependencies": {
44-
"arrify": "^3.0.0",
4544
"capture-website": "^3.0.0",
4645
"get-stdin": "^9.0.0",
4746
"meow": "^10.1.3",

test.js.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Generated by [AVA](https://avajs.dev).
3232
element: '.main-content',
3333
emulateDevice: 'iPhone X',
3434
fullPage: false,
35-
header: 'x-powered-by: capture-website-cli',
3635
headers: {
3736
'x-powered-by': 'capture-website-cli',
3837
},

test.js.snap

-19 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)