mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
feat: check reset working dir exists
This commit is contained in:
parent
325bd42734
commit
dfcad8082b
@ -11,6 +11,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Mrs4s/go-cqhttp/global"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
@ -140,6 +141,9 @@ func ResetWorkingDir() {
|
||||
}
|
||||
}
|
||||
p, _ := filepath.Abs(os.Args[0])
|
||||
if !global.PathExists(p) {
|
||||
log.Fatalf("重置工作目录时出现错误: 无法找到路径 %v", p)
|
||||
}
|
||||
proc := exec.Command(p, args...)
|
||||
proc.Stdin = os.Stdin
|
||||
proc.Stdout = os.Stdout
|
||||
|
Loading…
x
Reference in New Issue
Block a user