From dc9d1c0f3a7dca29e63a7b0907b884c3b0fee041 Mon Sep 17 00:00:00 2001 From: WeidiDeng Date: Mon, 12 Aug 2024 08:42:05 +0800 Subject: [PATCH] ignore exec.ErrDot when starting caddy in background --- cmd/commandfuncs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go index 746cf3da6b6..49d0321efae 100644 --- a/cmd/commandfuncs.go +++ b/cmd/commandfuncs.go @@ -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) }