ci: fix semgrep

This commit is contained in:
Andrey Nering 2025-02-10 15:05:20 -03:00
commit 51fa19b8b4

View file

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"io"
"io/fs"
"net/http"
"net/url"
"os"
@ -146,7 +147,7 @@ func sourceFromArg(arg string) (*source, error) {
func validateStyle(style string) error {
if style != "auto" && styles.DefaultStyles[style] == nil {
style = utils.ExpandPath(style)
if _, err := os.Stat(style); os.IsNotExist(err) {
if _, err := os.Stat(style); errors.Is(err, fs.ErrNotExist) {
return fmt.Errorf("Specified style does not exist: %s", style)
} else if err != nil {
return err