Skip to content

Commit b5f4703

Browse files
authored
Handle strings with mixed cases in edit command (#12)
1 parent 3452934 commit b5f4703

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# gh-milestone
22

3+
## 1.1.1
4+
5+
### Patch Changes
6+
7+
- Strings with mixed cases are now recognized and handled in `edit` subcommand.
8+
39
## 1.1.0
410

511
### Minor Changes

internal/cmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/valeriobelli/gh-milestone/internal/pkg/utils/cmdutil"
99
)
1010

11-
const version = "v1.1.0"
11+
const version = "v1.1.1"
1212

1313
func Execute() {
1414
var rootCommand = &cobra.Command{

internal/pkg/domain/commands/edit/state.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ func (flag *stateFlag) GetValue() *string {
2828

2929
func (flag *stateFlag) Set(value string) error {
3030
if slices.Contains(constants.CreateMilestoneStates, strings.ToUpper(value)) {
31-
*flag = stateFlag{string: &value}
31+
loweredValue := strings.ToLower(value)
32+
33+
*flag = stateFlag{string: &loweredValue}
3234

3335
return nil
3436
}

0 commit comments

Comments
 (0)