Skip to content

Commit

Permalink
Fixes issue #221
Browse files Browse the repository at this point in the history
  • Loading branch information
barnybug committed May 6, 2017
1 parent e8ba6f4 commit c758f26
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.8.8 (2017-05-06)

- Fix shortenName overzealously removes suffixes #221

## 0.8.7 (2016-11-22)

- Lowercase record names to make imports case-insensitive. Fixes #206
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

var r53 *route53.Route53
var version = "0.8.7"
var version = "0.8.8"

// Main entry point for cli53 application
func Main(args []string) int {
Expand Down
5 changes: 1 addition & 4 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,8 @@ func waitForChange(change *route53.ChangeInfo) {
func shortenName(name, origin string) string {
if name == origin {
return "@"
} else if strings.HasSuffix(name, origin) {
return name[0 : len(name)-len(origin)-1]
} else {
return name
}
return strings.TrimSuffix(name, "."+origin)
}

var reQuotedValue = regexp.MustCompile(`"((?:\\"|[^"])*)"`)
Expand Down
1 change: 1 addition & 0 deletions util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ func TestShortenName(t *testing.T) {
assert.Equal(t, "a", shortenName("a.example.com.", "example.com."))
assert.Equal(t, "a.", shortenName("a.", "example.com."))
assert.Equal(t, "a.b", shortenName("a.b.example.com.", "example.com."))
assert.Equal(t, "fineexample.com.", shortenName("fineexample.com.", "example.com."))
}

0 comments on commit c758f26

Please sign in to comment.