This commit is contained in:
2026-02-14 05:36:00 +08:00
commit d7cd899983
37 changed files with 4169 additions and 0 deletions

18
pkg/utils/utils.go Normal file
View File

@@ -0,0 +1,18 @@
package utils
import (
"os"
"os/exec"
)
// CommandExists 检查命令是否存在
func CommandExists(cmd string) bool {
_, err := exec.LookPath(cmd)
return err == nil
}
// FileExists 检查文件是否存在
func FileExists(path string) bool {
_, err := os.Stat(path)
return err == nil || !os.IsNotExist(err)
}