Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Oct 5, 2024
1 parent efa1189 commit 97dc795
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sp/sp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ func OfficialAvailableTest() error {
InitLogger()
defer Logger.Sync()
}
// 首先检查 speedtest 命令是否存在
_, err := exec.LookPath("speedtest")
if err != nil {
if model.EnableLoger {
Logger.Info("Speedtest command not found: " + err.Error())
}
return fmt.Errorf("Speedtest command not found")
}
// 再进行版本检测
spvCheck := exec.Command("speedtest", "--version")
output, err := spvCheck.CombinedOutput()
if err != nil {
Expand Down

0 comments on commit 97dc795

Please sign in to comment.