Skip to content
Snippets Groups Projects
Commit e5e1a1c1 authored by Jessica Yuen's avatar Jessica Yuen
Browse files

Fix 'env set' where --name flag is not specified

There is a bug where if --name is not passed during env set, an error is
thrown due to failed validation checking on an empty name. This commit
fixes this bug.
parent 73e75ee2
No related branches found
No related tags found
No related merge requests found
......@@ -246,14 +246,14 @@ func (m *manager) SetEnvironment(name string, desired *Environment) error {
return fmt.Errorf("Environment '%s' does not exist", name)
}
// ensure new environment name does not contain punctuation
if !isValidName(desired.Name) {
return fmt.Errorf("Environment name '%s' is not valid; must not contain punctuation, spaces, or begin or end with a slash", name)
}
// If the name has changed, the directory location needs to be moved to
// reflect the change.
if name != desired.Name && len(desired.Name) != 0 {
// ensure new environment name does not contain punctuation
if !isValidName(desired.Name) {
return fmt.Errorf("Environment name '%s' is not valid; must not contain punctuation, spaces, or begin or end with a slash", name)
}
log.Infof("Setting environment name from '%s' to '%s'", name, desired.Name)
// Ensure not overwriting another environment
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment