Skip to content

Commit

Permalink
refactor: add recursive & force on removing out
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Jan 28, 2025
1 parent 7086a7d commit 9206f11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/builders/ProjectBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class ProjectBuilder {
const args = this.getArgs('clean', opts);
return execa(wrapper, args, { stdio: 'inherit', cwd: path.resolve(this.root) })
.then(() => {
fs.rmSync(path.join(this.root, 'out'));
fs.rmSync(path.join(this.root, 'out'), { recursive: true, force: true });

['debug', 'release'].map(config => path.join(this.root, `${config}${SIGNING_PROPERTIES}`))
.forEach(file => {
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/builders/ProjectBuilder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe('ProjectBuilder', () => {

it('should remove "out" folder', () => {
return builder.clean({}).then(() => {
expect(fs.rmSync).toHaveBeenCalledWith(path.join(rootDir, 'out'));
expect(fs.rmSync).toHaveBeenCalledWith(path.join(rootDir, 'out'), { recursive: true, force: true });
});
});

Expand Down

0 comments on commit 9206f11

Please sign in to comment.