Skip to content

Commit

Permalink
fix: local.GroupUpdate cannot update empty description
Browse files Browse the repository at this point in the history
  • Loading branch information
d-strobel committed Jan 12, 2024
1 parent 566c4d2 commit 23604de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion windows/local/local_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ func (c *LocalClient) GroupUpdate(ctx context.Context, params GroupUpdateParams)
cmds = append(cmds, fmt.Sprintf("-Name '%s'", params.Name))
}

cmds = append(cmds, fmt.Sprintf("-Description '%s'", params.Description))
if params.Description == "" {
cmds = append(cmds, "-Description ' '")
} else {
cmds = append(cmds, fmt.Sprintf("-Description '%s'", params.Description))
}

cmd := strings.Join(cmds, " ")

// Run command
Expand Down
2 changes: 1 addition & 1 deletion windows/local/local_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (suite *LocalUnitTestSuite) TestGroupUpdate() {
{
"assert with Name parameter",
GroupUpdateParams{Name: "Test"},
"Set-LocalGroup -Name 'Test' -Description ''",
"Set-LocalGroup -Name 'Test' -Description ' '",
},
}

Expand Down

0 comments on commit 23604de

Please sign in to comment.