-
Notifications
You must be signed in to change notification settings - Fork 104
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
(SDK-290) Make sure that all usernames are processed when creating a new module #108
Conversation
Long term, I think we'll want to save the answers to the interview questions (where they're not specific to the module) into a file and read those in as the default values, so that users only have to provide forge username, preferred license etc once. For now though, I think aborting and asking the user to run without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An answer file will provide some relief for this. Talking about this also highlights that --skip-interview
will be the default for many people (If not for everyone, after their first new module
run). Aborting on skip-interview therefore would break the workflow for a majority of the people.
Please change the raise
to coerce, and log instead.
I've added some pending unit tests that show the behaviour I'd like to see. The failing acceptance tests are from a hidden merge conflict to master. Please rebase this, and address those issues. |
lib/pdk/generators/module.rb
Outdated
|
||
username = '' | ||
username = Etc.getlogin.gsub(%r{[^0-9a-z]}i, '') | ||
username = 'username' if username == '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This protects against an entirely non-alphanumeric username
No description provided.