Skip to content

Commit

Permalink
chore: Don't print exit status when exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Aug 6, 2022
1 parent 8492677 commit 155232a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ func (v VersionInfo) MarshalZerologObject(e *zerolog.Event) {
// Main runs chezmoi and returns an exit code.
func Main(versionInfo VersionInfo, args []string) int {
if err := runMain(versionInfo, args); err != nil {
if s := err.Error(); s != "" {
fmt.Fprintf(os.Stderr, "chezmoi: %s\n", s)
var errExitCode chezmoi.ExitCodeError
if errors.As(err, &errExitCode) {
return int(errExitCode)
}
errExitCode := chezmoi.ExitCodeError(1)
_ = errors.As(err, &errExitCode)
return int(errExitCode)
fmt.Fprintf(os.Stderr, "chezmoi: %v\n", err)
return 1
}
return 0
}
Expand Down

0 comments on commit 155232a

Please sign in to comment.