Skip to content

Commit

Permalink
lowercase error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
zeucapua committed Sep 10, 2024
1 parent 33c2057 commit 5e7e4bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions cmd/generate/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ func run(opts *Options) error {
// Open repo
repo, err := git.PlainOpen(opts.path)
if err != nil {
return fmt.Errorf("Error opening repo: %w", err)
return fmt.Errorf("error opening repo: %w", err)
}

commitIter, err := repo.CommitObjects()

if err != nil {
return fmt.Errorf("Error opening repo commits: %w", err)
return fmt.Errorf("error opening repo commits: %w", err)
}

var uniqueEmails []string
Expand All @@ -110,14 +110,14 @@ func run(opts *Options) error {
})

if err != nil {
return fmt.Errorf("Error iterating over repo commits: %w", err)
return fmt.Errorf("error iterating over repo commits: %w", err)
}

// INTERACTIVE: per unique email, set a name (existing or new or ignore)
if opts.isInteractive {
program := tea.NewProgram(initialModel(opts, uniqueEmails))
if _, err := program.Run(); err != nil {
return fmt.Errorf("Error running interactive mode: %w", err)
return fmt.Errorf("error running interactive mode: %w", err)
}
} else {
// generate an output file
Expand All @@ -127,12 +127,12 @@ func run(opts *Options) error {
homeDir, _ := os.UserHomeDir()
err := generateOutputFile(filepath.Join(homeDir, ".sauced.yaml"), attributionMap)
if err != nil {
return fmt.Errorf("Error generating output file: %w", err)
return fmt.Errorf("error generating output file: %w", err)
}
} else {
err := generateOutputFile(filepath.Join(opts.outputPath, ".sauced.yaml"), attributionMap)
if err != nil {
return fmt.Errorf("Error generating output file: %w", err)
return fmt.Errorf("error generating output file: %w", err)
}
}
}
Expand Down Expand Up @@ -256,12 +256,12 @@ func runOutputGeneration(opts *Options, attributionMap map[string][]string) tea.
homeDir, _ := os.UserHomeDir()
err := generateOutputFile(filepath.Join(homeDir, ".sauced.yaml"), attributionMap)
if err != nil {
return fmt.Errorf("Error generating output file: %w", err)
return fmt.Errorf("error generating output file: %w", err)
}
} else {
err := generateOutputFile(filepath.Join(opts.outputPath, ".sauced.yaml"), attributionMap)
if err != nil {
return fmt.Errorf("Error generating output file: %w", err)
return fmt.Errorf("error generating output file: %w", err)
}
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/generate/config/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func generateOutputFile(outputPath string, attributionMap map[string][]string) error {
file, err := os.Create(outputPath)
if err != nil {
return fmt.Errorf("Error creating %s file: %w", outputPath, err)
return fmt.Errorf("error creating %s file: %w", outputPath, err)
}
defer file.Close()

Expand All @@ -22,13 +22,13 @@ func generateOutputFile(outputPath string, attributionMap map[string][]string) e
yaml, err := utils.OutputYAML(config)

if err != nil {
return fmt.Errorf("Failed to turn into YAML: %w", err)
return fmt.Errorf("failed to turn into YAML: %w", err)
}

_, err = file.WriteString(yaml)

if err != nil {
return fmt.Errorf("Failed to turn into YAML: %w", err)
return fmt.Errorf("failed to turn into YAML: %w", err)
}

return nil
Expand Down

0 comments on commit 5e7e4bc

Please sign in to comment.