Skip to content

Commit

Permalink
rework: Address 3rd round of feedback provided on the pull request. F…
Browse files Browse the repository at this point in the history
…ix README.md and correct & update comments.
  • Loading branch information
pvbouwel committed Dec 6, 2022
1 parent e0e47b1 commit d63c744
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ defined at the top level then you can rename them using:
migration "state" "test" {
dir = "dir1"
actions = [
"xmv aws_security_group.* aws_security_group.${1}2",
"xmv aws_security_group.* aws_security_group.$${1}2",
]
}
```
Expand Down
5 changes: 2 additions & 3 deletions tfmigrate/state_xmv_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type StateXMvAction struct {

var _ StateAction = (*StateXMvAction)(nil)

// NewStateMvAction returns a new StateXMvAction instance.
// NewStateXMvAction returns a new StateXMvAction instance.
func NewStateXMvAction(source string, destination string) *StateXMvAction {
return &StateXMvAction{
source: source,
Expand Down Expand Up @@ -56,8 +56,7 @@ func (a *StateXMvAction) generateMvActions(ctx context.Context, tf tfexec.Terraf
return a.getStateMvActionsForStateList(stateList)
}

// When a wildcardChar is used in a path it should only match a single part of the path
// It can therefore not contain a dot(.), whitespace nor square brackets
// A wildcardChar will greedy match with any character in the resource path.
const matchWildcardRegex = "(.*)"
const wildcardChar = "*"

Expand Down

0 comments on commit d63c744

Please sign in to comment.