Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
[Refactor] replace rimraf with fs.rmSync recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 31, 2024
1 parent 517cfa1 commit 7ba7bec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions getProjectTempDir.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
const tmp = require('tmp');
const nodeCleanup = require('node-cleanup');
const semver = require('semver');
const rimraf = require('rimraf');
const colors = require('colors/safe');

const path = require('path');
const { exec, execSync } = require('child_process');
const { rmSync } = require('fs');
const { writeFile } = require('fs').promises;

const cleanupHandlers = [];
Expand Down Expand Up @@ -47,7 +47,7 @@ const getRootTempDir = function getRootTempDir(npmNeeded, logger = () => {}) {
JSON.stringify(pkgContents),
).then(() => new Promise((resolve, reject) => {
cleanupHandlers.unshift(() => {
rimraf.sync(path.join(tmpDir, '*'));
rmSync(path.join(tmpDir, '*'), { recursive: true, force: true });
});
exec('npm install --no-package-lock --silent >/dev/null', { cwd: tmpDir }, (err) => {
if (err) {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"libnpx": "^10.2.4",
"node-cleanup": "^2.1.2",
"npm-lockfile": "^4.0.0",
"rimraf": "=5.0.7",
"semver": "^7.6.3",
"tmp": "^0.2.3"
},
Expand Down

0 comments on commit 7ba7bec

Please sign in to comment.