diff --git a/npm-run-clean.js b/npm-run-clean.js new file mode 100644 index 000000000..589dac3eb --- /dev/null +++ b/npm-run-clean.js @@ -0,0 +1,19 @@ +#!/usr/bin/env node +'use strict' + +const { promisify } = require('util') +const rimraf = promisify(require('rimraf')) + +Promise.all([ + '**/.nyc_output', + 'node_modules/.cache', + '.self_coverage', + 'test/**/.cache', + 'test/fixtures/cli/coverage', + 'test/fixtures/cli/fakebin/node', + 'test/fixtures/cli/fakebin/npm', + 'test/fixtures/cli/foo-cache', + 'test/fixtures/cli/nyc-config-js/node_modules', + 'test/temp-dir-*', + 'self-coverage' +].map(f => rimraf(f, { cwd: __dirname }))) diff --git a/package.json b/package.json index da256e97a..c3488937c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test": "tap", "snap": "npm test -- --snapshot", "posttest": "npm run report", - "clean": "rimraf ./.nyc_output ./node_modules/.cache ./.self_coverage ./test/fixtures/.nyc_output ./test/fixtures/node_modules/.cache ./test/fixtures/cli/foo-cache ./test/temp-dir-* ./self-coverage", + "clean": "node ./npm-run-clean.js", "instrument": "node ./build-self-coverage.js", "report": "node ./bin/nyc report --temp-dir ./.self_coverage/ -r text -r lcov", "release": "standard-version"