mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-09 09:49:09 +02:00
ci: fix semgrep
This commit is contained in:
parent
05e5b2e279
commit
51fa19b8b4
1 changed files with 2 additions and 1 deletions
3
main.go
3
main.go
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue