Skip to content

Commit

Permalink
fix(human): skip capitalize on uuid (#2510)
Browse files Browse the repository at this point in the history
  • Loading branch information
Codelax authored Sep 19, 2022
1 parent 364a689 commit a5fb125
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions internal/human/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ package human

import (
"reflect"
"strings"
"unicode"
)

// Capitalize returns the given string with a first character in uppercase.
func Capitalize(s string) string {
words := strings.Fields(s)
if len(words) > 0 && strings.Contains(words[0], "-") {
// First word is probably an id, don't capitalize
return s
}

for i, c := range s {
return string(unicode.ToUpper(c)) + s[i+1:]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️
Scaleway-sdk-go: cannot read config file /tmp/test_config_destroy/.config/scw/config.yaml: no such file or directory
scaleway-sdk-go: cannot read config file /tmp/test_config_destroy/.config/scw/config.yaml: no such file or directory
πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯
{
"error": "scaleway-sdk-go: cannot read config file /tmp/test_config_destroy/.config/scw/config.yaml: no such file or directory"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️
Scaleway-sdk-go: couldn't find a matching image for the given label (macos), zone (fr-par-1) and commercial type (DEV1-S)
scaleway-sdk-go: couldn't find a matching image for the given label (macos), zone (fr-par-1) and commercial type (DEV1-S)
πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯
{
"error": "scaleway-sdk-go: couldn't find a matching image for the given label (macos), zone (fr-par-1) and commercial type (DEV1-S)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️
Scaleway-sdk-go: couldn't find a matching image for the given label (ubuntu_bionic), zone (fr-par-1) and commercial type (MACBOOK1-S): couldn't find compatible local image for this image version (47d38b1a-71a9-4f29-80bc-2dbb7bda7f9f)
scaleway-sdk-go: couldn't find a matching image for the given label (ubuntu_bionic), zone (fr-par-1) and commercial type (MACBOOK1-S): couldn't find compatible local image for this image version (47d38b1a-71a9-4f29-80bc-2dbb7bda7f9f)
πŸŸ₯πŸŸ₯πŸŸ₯ JSON STDERR πŸŸ₯πŸŸ₯πŸŸ₯
{
"error": "scaleway-sdk-go: couldn't find a matching image for the given label (ubuntu_bionic), zone (fr-par-1) and commercial type (MACBOOK1-S): couldn't find compatible local image for this image version (47d38b1a-71a9-4f29-80bc-2dbb7bda7f9f)"
Expand Down

0 comments on commit a5fb125

Please sign in to comment.