Skip to content

Commit

Permalink
chore: Add force option to rmSync call (#33570)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman authored Oct 14, 2024
1 parent 8c8238e commit dc4d248
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/i18n/src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/index.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit dc4d248

Please sign in to comment.