Skip to content

Commit

Permalink
Simplify gulp task
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 7, 2023
1 parent 47dfd62 commit d978100
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions gulp/download.js
@@ -1,12 +1,8 @@
import { createWriteStream } from 'node:fs'
import { pipeline } from 'node:stream'
import { promisify } from 'node:util'
import { pipeline } from 'node:stream/promises'

import { got } from 'got'

// TODO: use `stream/promises` instead once dropping support for Node <15.0.0
const pPipeline = promisify(pipeline)

const CODECOV_DIST = new URL('../src/tasks/cover/codecov.sh', import.meta.url)
const CODECOV_URL = 'https://codecov.io/bash'

Expand All @@ -19,7 +15,7 @@ const CODECOV_URL = 'https://codecov.io/bash'
export const download = async () => {
const response = await got.stream(CODECOV_URL)
const stream = createWriteStream(CODECOV_DIST)
await pPipeline(response, stream)
await pipeline(response, stream)
}

download.description = 'Download latest codecov upload script'

0 comments on commit d978100

Please sign in to comment.