From dc4d24864757a9c0c413bd232e3c55ac8775e973 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Mon, 14 Oct 2024 14:13:13 -0600 Subject: [PATCH] chore: Add `force` option to `rmSync` call (#33570) --- packages/i18n/src/index.mjs | 2 +- packages/i18n/src/index.spec.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/i18n/src/index.mjs b/packages/i18n/src/index.mjs index 67c1c18a0183..bfabf1f2ee41 100644 --- a/packages/i18n/src/index.mjs +++ b/packages/i18n/src/index.mjs @@ -101,7 +101,7 @@ const languages = files.map((file) => path.basename(file, '.i18n.json')); // write the files if (fs.existsSync(`./dist`)) { - fs.rmSync(`./dist`, { recursive: true }); + fs.rmSync(`./dist`, { recursive: true, force: true }); } fs.mkdirSync(`./dist`, { recursive: true }); diff --git a/packages/i18n/src/index.spec.mjs b/packages/i18n/src/index.spec.mjs index b3efdaa10175..4e088186e295 100644 --- a/packages/i18n/src/index.spec.mjs +++ b/packages/i18n/src/index.spec.mjs @@ -10,7 +10,7 @@ describe('i18n', () => { jest.spyOn(fs, 'writeFileSync').mockImplementation(() => {}); jest.spyOn(fs, 'readFileSync').mockImplementation(() => JSON.stringify({})); jest.spyOn(fs, 'existsSync').mockReturnValue(true); - jest.spyOn(fs, 'rmdirSync').mockImplementation(() => {}); + jest.spyOn(fs, 'rmSync').mockImplementation(() => {}); }); afterEach(() => {