Skip to content

Commit

Permalink
fix(cli): Use correct Node streams for transferKey::retrieveKey()
Browse files Browse the repository at this point in the history
  • Loading branch information
nellh committed Nov 21, 2023
1 parent 007c955 commit d90691a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/openneuro-cli/src/transferKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ export async function retrieveKey(state, key, file) {
const response = await fetch(request)
if (response.status === 200) {
const writable = createWriteStream(file)
const readable = await response.readable()
readable.pipe(writable)
await once(readable, "close")
response.body.pipe(writable)
await once(response.body, "close")
return true
} else {
return false
Expand Down

0 comments on commit d90691a

Please sign in to comment.