cmd: ignore exec.ErrDot when starting caddy in background (#6512)

Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
This commit is contained in:
WeidiDeng 2024-08-13 10:26:20 +08:00 committed by GitHub
parent 3a48b03369
commit 9ddb78fadc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,6 +74,10 @@ func cmdStart(fl Flags) (int, error) {
// sure by giving it some random bytes and having it echo
// them back to us)
cmd := exec.Command(os.Args[0], "run", "--pingback", ln.Addr().String())
// we should be able to run caddy in relative paths
if errors.Is(cmd.Err, exec.ErrDot) {
cmd.Err = nil
}
if configFlag != "" {
cmd.Args = append(cmd.Args, "--config", configFlag)
}