Skip to content

Commit

Permalink
Build: Replace rimraf with built-in fs.rmSync
Browse files Browse the repository at this point in the history
Available since Node.js 14.14.0, we now require Node.js 18.
  • Loading branch information
Krinkle committed May 30, 2024
1 parent fcc0d67 commit 7ada32c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
4 changes: 1 addition & 3 deletions build/build-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ const Repo = {
cdnClone (repoPath) {
const remote = cdnRemotes.anonymous;
console.log('... cloning ' + remote);
if (fs.existsSync(repoPath)) {
fs.rmdirSync(repoPath, { recursive: true });
}
fs.rmSync(repoPath, { recursive: true, force: true });
cp.execFileSync('git', [
'clone',
'--depth=5',
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"nyc": "^15.1.0",
"proxyquire": "^1.8.0",
"requirejs": "^2.3.6",
"rimraf": "^3.0.2",
"rollup": "^2.79.1"
},
"scripts": {
Expand Down
5 changes: 2 additions & 3 deletions test/cli/cli-watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const fs = require('fs');
const path = require('path');
const fixturify = require('fixturify');
const rimraf = require('rimraf');

const expectedWatchOutput = require('./fixtures/expected/watch-tap-outputs');
const { execute } = require('./helpers/execute');
Expand All @@ -29,7 +28,7 @@ if (process.platform === 'win32') {

QUnit.module('CLI Watch', function (hooks) {
hooks.before(function () {
rimraf.sync(fixturePath);
fs.rmSync(fixturePath, { recursive: true, force: true });
});

hooks.beforeEach(function () {
Expand All @@ -40,7 +39,7 @@ QUnit.module('CLI Watch', function (hooks) {
});

hooks.afterEach(function () {
rimraf.sync(fixturePath);
fs.rmSync(fixturePath, { recursive: true, force: true });
});

QUnit.test('runs tests and waits until SIGTERM', async assert => {
Expand Down

0 comments on commit 7ada32c

Please sign in to comment.