-
Notifications
You must be signed in to change notification settings - Fork 332
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
Project name input is not being sanitized #103
Conversation
cmd/ui/textinput/textinput.go
Outdated
// InitialTextInputModel initializes a textinput step | ||
// with the given data | ||
func InitialTextInputModel(output *Output, header string, program *program.Project) model { | ||
ti := textinput.New() | ||
ti.Focus() | ||
ti.CharLimit = 156 | ||
ti.Width = 20 | ||
ti.Validate = sanitizeInput |
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.
nit: format?
cmd/ui/textinput/textinput_test.go
Outdated
|
||
import "testing" | ||
|
||
|
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.
nit: extra space?
|
||
|
||
|
||
func TestInputSanitization(t *testing.T) { |
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 is really cool - first test LUl
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.
LGTHT foool
* Gives an error if a directory already exists. Colorized the errors when creating a new project if occurred (Melkeydev#72) Co-authored-by: Omar <[email protected]> * fix 🐛: added hotfix to taps on homebrew (Melkeydev#87) * fix 🐛: completion in homebrew (Melkeydev#100) * fix 🐛: completion in homebrew * fix 🐛: added comment about the use of the GoBlueprintVersion variable * feat ✨: added missing completion install in goreleaser config * fix 🐛: misstyped completion file name * fix 🐛: permissions on completion script * fix 🐛: missing archived complition folder needed for completion in brew * fix 🐛: fixed ldfs flag * docs 📚(README.md): fixed the brew installation command * Project name input is not being sanitized (Melkeydev#103) * fix: No project name input sanitization * feat: Starting continuous integration * fix: nits --------- Co-authored-by: Omar <[email protected]> Co-authored-by: Omar <[email protected]> Co-authored-by: Zine Moualhi <[email protected]> Co-authored-by: Camilo <[email protected]>
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
Problem/Feature
I can pass two or more spaces as a project name causing it to fail. In the same way I can pass special characters that can mess with the integrity of the target file tree.
Description of Changes:
Checklist