Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc(build): ensure distDir is present before emptying it #12829

Merged
merged 3 commits into from
Aug 3, 2021

Conversation

paulirish
Copy link
Member

fixes #12800 ( i could repro )

@paulirish paulirish requested a review from a team as a code owner July 27, 2021 20:07
@paulirish paulirish requested review from adamraine and removed request for a team July 27, 2021 20:07
@google-cla google-cla bot added the cla: yes label Jul 27, 2021
@paulirish paulirish changed the title build: ensure distDir is present before emptying it misc(build): ensure distDir is present before emptying it Jul 27, 2021
fs.rmdirSync(distDir, {recursive: true});
fs.mkdirSync(distDir);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead we can use fs.rmSync with force: true and recursive: true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm/rmSync aren't supported until Node 14

Copy link
Member Author

@paulirish paulirish Jul 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rmSync is new in node 14. (not in 12). :/

fsPromises.rmdir has force, but will require a bigger diff in this file. jk, my mistake. need the rm method in sync or promises versions. both need node 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

yarn build:all throws exception upon building from source
5 participants