Skip to content

Commit

Permalink
feat: check reset working dir exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrs4s committed Feb 23, 2022
1 parent 325bd42 commit dfcad80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/base/flag.go
Expand Up @@ -11,6 +11,7 @@ import (
"strings"
"time"

"github.com/Mrs4s/go-cqhttp/global"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dfcad80

Please sign in to comment.