Skip to content

Commit

Permalink
Add before and after names with quotes to show spacing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
digivava committed Mar 24, 2022
1 parent e5f4408 commit 7677a06
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions command/policy_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ func (c *PolicyWriteCommand) Run(args []string) int {
}

// Policies are normalized to lowercase
name := args[0]
formattedName := strings.TrimSpace(strings.ToLower(name))
policyName := args[0]
formattedName := strings.TrimSpace(strings.ToLower(policyName))
path := strings.TrimSpace(args[1])

// Get the policy contents, either from stdin of a file
Expand Down Expand Up @@ -125,8 +125,8 @@ func (c *PolicyWriteCommand) Run(args []string) int {
return 2
}

if name != formattedName {
c.UI.Warn(fmt.Sprintf("Policy name was converted to %s", formattedName))
if policyName != formattedName {
c.UI.Warn(fmt.Sprintf("Policy name was converted from \"%s\" to \"%s\"", policyName, formattedName))
}

c.UI.Output(fmt.Sprintf("Success! Uploaded policy: %s", formattedName))
Expand Down

0 comments on commit 7677a06

Please sign in to comment.