1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-04 19:17:37 +08:00

fix: import cycle

This commit is contained in:
Mrs4s 2022-02-24 01:15:42 +08:00
parent 0f06688ac6
commit d4c2b62e5e
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7

View File

@ -11,7 +11,7 @@ import (
"strings"
"time"
"github.com/Mrs4s/go-cqhttp/global"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"
@ -141,7 +141,8 @@ func ResetWorkingDir() {
}
}
p, _ := filepath.Abs(os.Args[0])
if !global.PathExists(p) {
_, err := os.Stat(p)
if !(err == nil || errors.Is(err, os.ErrExist)) {
log.Fatalf("重置工作目录时出现错误: 无法找到路径 %v", p)
}
proc := exec.Command(p, args...)
@ -149,7 +150,7 @@ func ResetWorkingDir() {
proc.Stdout = os.Stdout
proc.Stderr = os.Stderr
proc.Dir = wd
err := proc.Run()
err = proc.Run()
if err != nil {
panic(err)
}