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(create): Ignore errors removing directory after download failed #8841

Merged
merged 5 commits into from
Oct 24, 2023

Conversation

Genteure
Copy link
Contributor

@Genteure Genteure commented Oct 15, 2023

Changes

  • Skip cleanup if the path is ., ./ or starts with ../.
  • Catches and ignore errors calling rmdirSync after template download failed.

This ensures the original "download failed" error is thrown and displayed to the user instead of a "rmdir failed" error which could be confusing.

Closes #8785

Testing

No new tests were added.
The changed function is not covered by existing tests.

Docs

No docs changes were made.
I don't think this behavior detail is worth documenting on docs.astro.build.

@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2023

🦋 Changeset detected

Latest commit: e854639

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: create-astro Related to the `create-astro` package (scope) label Oct 15, 2023
@github-actions github-actions bot added the docs pr A PR that includes documentation for review label Oct 23, 2023
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Just left a suggestion for you to consider, @Genteure ! 🙌

.changeset/soft-berries-prove.md Outdated Show resolved Hide resolved
@natemoo-re natemoo-re merged commit f2dd895 into withastro:main Oct 24, 2023
13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Oct 24, 2023
natemoo-re added a commit that referenced this pull request Nov 22, 2023
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs pr A PR that includes documentation for review pkg: create-astro Related to the `create-astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure to cleanup masks real error when creating new project
4 participants