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

Validate site name on init command #264

Merged
merged 2 commits into from
Apr 4, 2019
Merged

Validate site name on init command #264

merged 2 commits into from
Apr 4, 2019

Conversation

eduardoboucas
Copy link
Member

@eduardoboucas eduardoboucas commented Mar 11, 2019

- Summary

When creating a new site using the web UI, the site name is subject to a validation rule that allows only alphanumeric characters and hyphens. The same doesn't happen when using the netlify init command in the CLI. This PR addresses that by introducing a validation rule with the same regular expression used in the web flow.

I've also added a few cosmetic changes to some user-facing messages in the init command, to make words like Netlify and GitHub capitalized in a consistent manner. I'm more than happy to make this a different PR (or discard it altogether), if you prefer.

- Test plan

I started writing an integration test, but then I saw that there is a big change to the testing architecture underway in #254. I didn't want to create possible merge conflicts, so I've refrained from committing the tests for now. Happy to revisit.

The change makes use of inquirer's validate method, which displays an error when the user tries to input an invalid value.

Screenshot 2019-03-11 at 12 58 54

The error message is consistent with the instructions shown in the web UI.

- Description for the changelog

Validates site name on init command. Closes #211.

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

A picture of a cute dog

Copy link
Contributor

@bcomnes bcomnes left a comment

Choose a reason for hiding this comment

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

LGTM!

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

Successfully merging this pull request may close these issues.

don't accept periods in Site name in netlify init
2 participants