Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoisaiah committed May 24, 2020
1 parent 0669533 commit 17371e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/goname/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
yellow = color.FgYellow.Render
)

// Change represents a single filename change
type Change struct {
source string
target string
Expand Down Expand Up @@ -56,7 +57,7 @@ func (op *Operation) Apply() error {
for _, ch := range op.matches {
if op.exec {
if err := os.Rename(ch.source, ch.target); err != nil {
return fmt.Errorf("An error occured while renaming '%s' to '%s'", ch.source, ch.target)
return fmt.Errorf("An error occurred while renaming '%s' to '%s'", ch.source, ch.target)
}
} else {
fmt.Println(ch.source, "➟", green(ch.target), "✅")
Expand Down Expand Up @@ -214,7 +215,7 @@ func (op *Operation) Replace() error {
// from command line flags & arguments
func NewOperation(c *cli.Context) (*Operation, error) {
if c.String("find") == "" && c.String("replace") == "" {
return nil, fmt.Errorf("Invalid arguments: one of `-f` or `-r` must be present and set to a non empty string value\nUse 'goname --help' for more information.")
return nil, fmt.Errorf("Invalid arguments: one of `-f` or `-r` must be present and set to a non empty string value\nUse 'goname --help' for more information")
}

op := &Operation{}
Expand Down

0 comments on commit 17371e6

Please sign in to comment.