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

fix: improve console message when unlinking from directory without a … #6897

Merged
merged 3 commits into from
Oct 25, 2024

Conversation

benhancock
Copy link
Contributor

@benhancock benhancock commented Oct 23, 2024

…netlify.toml

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes #6895

Before, if a user called netlify unlink while linked to a site whose local directory did not have a netlify.toml, the site would unlink successfully but with a Unlinked undefined from <site-name> message. This is because when the local directory for a linked site does not have a netlify.toml,site.configPath is undefined in unlink.ts, and so undefined gets interpolated into the output message. We now check to see if site.siteConfig is truthy before interpolating the path to the netlify.toml, otherwise if it is not defined we output Unlinked from <site-name>.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@benhancock benhancock requested a review from a team as a code owner October 23, 2024 14:40
@DanielSLew DanielSLew enabled auto-merge (squash) October 25, 2024 19:14
@DanielSLew DanielSLew merged commit 622098e into netlify:main Oct 25, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants