Skip to content

Commit

Permalink
chore(deps): Remove rimraf (bcoe#509)
Browse files Browse the repository at this point in the history
feat(deps): use Node.js built in rm
feat(build)!: minimum Node.js version is now 14.14.0
  • Loading branch information
w3nl authored and mcknasty committed Jan 3, 2024
1 parent 433aefa commit f60dfc9
Show file tree
Hide file tree
Showing 5 changed files with 1,580 additions and 1,045 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12, 14, 16, 18]
node: [14, 16, 18, 20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
Expand All @@ -24,8 +24,8 @@ jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
Expand All @@ -34,8 +34,8 @@ jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
Expand Down
15 changes: 3 additions & 12 deletions bin/c8.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

const foreground = require('foreground-child')
const { outputReport } = require('../lib/commands/report')
const { promises } = require('fs')
const { promisify } = require('util')
const rimraf = require('rimraf')
const { rm, mkdir } = require('fs/promises')
const {
buildYargs,
hideInstrumenteeArgs,
Expand All @@ -21,18 +19,11 @@ async function run () {
].indexOf(argv._[0]) !== -1) {
argv = buildYargs(true).parse(process.argv.slice(2))
} else {
// fs.promises was not added until Node.js v10.0.0, if it doesn't
// exist, assume we're Node.js v8.x and skip coverage.
if (!promises) {
foreground(hideInstrumenterArgs(argv))
return
}

if (argv.clean) {
await promisify(rimraf)(argv.tempDirectory)
await rm(argv.tempDirectory, { recursive: true, force: true })
}

await promises.mkdir(argv.tempDirectory, { recursive: true })
await mkdir(argv.tempDirectory, { recursive: true })
process.env.NODE_V8_COVERAGE = argv.tempDirectory
foreground(hideInstrumenterArgs(argv), async (done) => {
try {
Expand Down
Loading

0 comments on commit f60dfc9

Please sign in to comment.