From de6e6a69a1a8b622431677180a42d7a0de3c42b1 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Fri, 17 Mar 2023 10:36:22 +0100 Subject: [PATCH] chore: remove rimraf from browsers (#9874) --- package-lock.json | 2 -- packages/browsers/package.json | 1 - packages/browsers/src/Cache.ts | 9 ++++++--- packages/browsers/test/src/firefox-data.spec.ts | 8 +++++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7483ee8ed4f..c1e8d021c16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9138,7 +9138,6 @@ "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", - "rimraf": "4.4.0", "tar-fs": "2.1.1", "unbzip2-stream": "1.4.3", "yargs": "17.7.1" @@ -10097,7 +10096,6 @@ "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", - "rimraf": "4.4.0", "tar-fs": "2.1.1", "unbzip2-stream": "1.4.3", "yargs": "17.7.1" diff --git a/packages/browsers/package.json b/packages/browsers/package.json index 13ff335cffb..3ed4139a33f 100644 --- a/packages/browsers/package.json +++ b/packages/browsers/package.json @@ -75,7 +75,6 @@ "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", - "rimraf": "4.4.0", "tar-fs": "2.1.1", "unbzip2-stream": "1.4.3", "yargs": "17.7.1" diff --git a/packages/browsers/src/Cache.ts b/packages/browsers/src/Cache.ts index 457a7a8e6a7..372d1350187 100644 --- a/packages/browsers/src/Cache.ts +++ b/packages/browsers/src/Cache.ts @@ -14,10 +14,9 @@ * limitations under the License. */ +import fs from 'fs'; import path from 'path'; -import rimraf from 'rimraf'; - import {Browser, BrowserPlatform} from './browser-data/browser-data.js'; /** @@ -54,6 +53,10 @@ export class Cache { } clear(): void { - rimraf.sync(this.#rootDir); + fs.rmSync(this.#rootDir, { + force: true, + recursive: true, + maxRetries: 5, + }); } } diff --git a/packages/browsers/test/src/firefox-data.spec.ts b/packages/browsers/test/src/firefox-data.spec.ts index ef9b2b6b75f..8ff72993090 100644 --- a/packages/browsers/test/src/firefox-data.spec.ts +++ b/packages/browsers/test/src/firefox-data.spec.ts @@ -19,8 +19,6 @@ import fs from 'fs'; import os from 'os'; import path from 'path'; -import rimraf from 'rimraf'; - import {BrowserPlatform} from '../../lib/cjs/browser-data/browser-data.js'; import { createProfile, @@ -85,7 +83,11 @@ describe('Firefox', () => { }); afterEach(() => { - rimraf.sync(tmpDir); + fs.rmSync(tmpDir, { + force: true, + recursive: true, + maxRetries: 5, + }); }); it('should create a profile', async () => {