From a4892db6a73b31ae17e7e9cb93e033cc5657a691 Mon Sep 17 00:00:00 2001 From: Bojan Angjelkoski Date: Mon, 6 Feb 2023 09:18:28 +0100 Subject: [PATCH] chore: use rimraf --- nuxt-config/hooks/index.ts | 5 +++-- package.json | 1 + yarn.lock | 12 ++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/nuxt-config/hooks/index.ts b/nuxt-config/hooks/index.ts index 46339aed1..93ca98706 100644 --- a/nuxt-config/hooks/index.ts +++ b/nuxt-config/hooks/index.ts @@ -1,6 +1,7 @@ /* eslint-disable no-console */ import path from 'path' -import { copy, mkdir, removeSync, pathExistsSync, copySync } from 'fs-extra' +import rimraf from 'rimraf' +import { copy, mkdir, pathExistsSync, copySync } from 'fs-extra' import nitroConfig from './nitro' import webpackConfig from './webpack' @@ -20,7 +21,7 @@ export default { 'build:before'() { try { if (outDirPathExist) { - removeSync(tokenMetadataDstDir) + rimraf.sync(tokenMetadataDstDir) } } catch (e) { console.log(`Error deleting dir: ${e}`) diff --git a/package.json b/package.json index dc0ed955c..85d59b53c 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ "@types/fs-extra": "^9.0.13", "@types/lodash": "^4.14.168", "@types/node": "^18.11.17", + "@types/rimraf": "^4.0.5", "@types/vue-select": "^3.16.2", "@vitest/coverage-c8": "^0.26.0", "@vue/test-utils": "^2.2.8", diff --git a/yarn.lock b/yarn.lock index 74b80f739..5b889df14 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4428,6 +4428,13 @@ dependencies: "@types/node" "*" +"@types/rimraf@^4.0.5": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-4.0.5.tgz#7a59be11605c22ea3959c21ff8b28b9df1bae1b2" + integrity sha512-DTCZoIQotB2SUJnYgrEx43cQIUYOlNZz0AZPbKU4PSLYTUdML5Gox0++z4F9kQocxStrCmRNhi4x5x/UlwtKUA== + dependencies: + rimraf "*" + "@types/sax@^1.2.0": version "1.2.4" resolved "https://registry.yarnpkg.com/@types/sax/-/sax-1.2.4.tgz#8221affa7f4f3cb21abd22f244cfabfa63e6a69e" @@ -14756,6 +14763,11 @@ rfdc@^1.3.0: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== +rimraf@*: + version "4.1.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.1.2.tgz#20dfbc98083bdfaa28b01183162885ef213dbf7c" + integrity sha512-BlIbgFryTbw3Dz6hyoWFhKk+unCcHMSkZGrTFVAx2WmttdBSonsdtRlwiuTbDqTKr+UlXIUqJVS4QT5tUzGENQ== + rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"