Skip to content

Commit

Permalink
fix the breaking change included by golang 1.19 about exec.LookPath() (
Browse files Browse the repository at this point in the history
  • Loading branch information
kira1928 authored Jan 3, 2023
1 parent c2489c0 commit a41d34d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ import (
"encoding/hex"
"math/rand"
"net/url"
"os"
"os/exec"
"regexp"
)

func IsFFmpegExist() bool {
_, ok := exec.LookPath("ffmpeg")
return ok == nil
_, err := exec.LookPath("ffmpeg")
if err != nil {
// exec.LookPath no longer searches current directory since golang 1.19,
// so we check the current directory separately
_, err = os.Stat("ffmpeg")
}
return err == nil
}

func GetMd5String(b []byte) string {
Expand Down

0 comments on commit a41d34d

Please sign in to comment.