Skip to content

Commit

Permalink
fix: set-exit-status on recursivePath
Browse files Browse the repository at this point in the history
This fixes set-exit-status when using `./...`
  • Loading branch information
micaelmalta committed May 27, 2024
1 parent 5f29621 commit 3688bea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
"os/user"
"path"
"path/filepath"
"github.com/incu6us/goimports-reviser/v3/helper"

"strings"

"github.com/incu6us/goimports-reviser/v3/helper"
"github.com/incu6us/goimports-reviser/v3/reviser"
)

Expand Down Expand Up @@ -275,6 +276,9 @@ func main() {
log.Fatalf("Failed to find unformatted files %s: %+v\n", originPath, err)
}
fmt.Printf("%s\n", unformattedFiles.String())
if *setExitStatus && unformattedFiles != nil {
os.Exit(1)
}
return
}
err := reviser.NewSourceDir(originProjectName, originPath, *isRecursive, excludes).Fix(options...)
Expand Down

0 comments on commit 3688bea

Please sign in to comment.