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:
parent
0f06688ac6
commit
d4c2b62e5e
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user