feat(xo-cli): @=-
can now read from stdin
This commit is contained in:
parent
f012d126b9
commit
76a91cc5e9
@ -567,9 +567,9 @@ async function call(args) {
|
|||||||
ensurePathParam(method, file)
|
ensurePathParam(method, file)
|
||||||
url = new URL(result[key], baseUrl)
|
url = new URL(result[key], baseUrl)
|
||||||
|
|
||||||
const { size: length } = await stat(file)
|
const length = file === '-' ? undefined : (await stat(file)).size
|
||||||
const input = pipeline(
|
const input = pipeline(
|
||||||
createReadStream(file),
|
file === '-' ? process.stdin : createReadStream(file),
|
||||||
progressStream(
|
progressStream(
|
||||||
{
|
{
|
||||||
length,
|
length,
|
||||||
@ -583,7 +583,7 @@ async function call(args) {
|
|||||||
const response = await hrp(url, {
|
const response = await hrp(url, {
|
||||||
...httpOptions,
|
...httpOptions,
|
||||||
body: input,
|
body: input,
|
||||||
headers: {
|
headers: length && {
|
||||||
'content-length': length,
|
'content-length': length,
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
Loading…
Reference in New Issue
Block a user