diff --git a/classes/publish/package/tasks/cleanup.js b/classes/publish/package/tasks/cleanup.js index 4f478eeb..46e6e71c 100644 --- a/classes/publish/package/tasks/cleanup.js +++ b/classes/publish/package/tasks/cleanup.js @@ -1,6 +1,6 @@ import { join } from 'path'; import fs from 'fs'; -import rimraf from 'rimraf'; +import { rimrafSync } from 'rimraf'; import Task from './task.js'; export default class Cleanup extends Task { @@ -11,7 +11,7 @@ export default class Cleanup extends Task { if (fs.existsSync(path)) { fs.readdirSync(path) .filter((file) => file !== 'integrity.json') - .forEach((file) => rimraf.sync(join(path, file))); + .forEach((file) => rimrafSync(join(path, file))); } } } diff --git a/package.json b/package.json index 83b42895..dc4b9a90 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "gzip-size": "7.0.0", "make-dir": "5.0.0", "ora": "8.0.1", - "rimraf": "3.0.2", + "rimraf": "6.0.1", "semver": "7.6.3", "ssri": "10.0.6", "tar": "7.4.3", diff --git a/test/tasks/cleanup.test.mjs b/test/tasks/cleanup.test.mjs index 45fa6b5c..902c2b49 100644 --- a/test/tasks/cleanup.test.mjs +++ b/test/tasks/cleanup.test.mjs @@ -1,7 +1,7 @@ import { promises as fs } from 'fs'; import { join } from 'path'; import { test, beforeEach, afterEach } from 'tap'; -import rimraf from 'rimraf'; +import { rimrafSync } from 'rimraf'; import CleanupTask from '../../classes/publish/package/tasks/cleanup.js'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; @@ -28,7 +28,7 @@ beforeEach(async (t) => { }); afterEach((t) => { - rimraf.sync(t.context.path); + rimrafSync(t.context.path); }); test('basic cleanup', async (t) => {