From f74ee60bd817188cee5842c45bdf2bda55f0b0a4 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 28 Dec 2020 08:49:32 -0700 Subject: [PATCH] Update readme, specify local binary when executing --- README.md | 9 +++++++++ cmd/xcaddy/main.go | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7294959..48df5e4 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,15 @@ $ xcaddy build \ --with github.com/caddyserver/ntlm-transport@v0.1.1=../../my-fork ``` +You can even replace Caddy core using the `--with` flag: + +``` +$ xcaddy build \ + --with github.com/caddyserver/caddy/v2=../../my-caddy-fork +``` + +This allows you to hack on Caddy core (and optionally plug in extra modules at the same time!) with relative ease. + ### For plugin development If you run `xcaddy` from within the folder of the Caddy plugin you're working on _without the `build` subcommand_, it will build Caddy with your current module and run it, as if you manually plugged it in and invoked `go run`. diff --git a/cmd/xcaddy/main.go b/cmd/xcaddy/main.go index acf4658..bc0fe58 100644 --- a/cmd/xcaddy/main.go +++ b/cmd/xcaddy/main.go @@ -141,7 +141,7 @@ func getCaddyOutputFile() string { if runtime.GOOS == "windows" { return "caddy.exe" } - return "caddy" + return "." + string(filepath.Separator) + "caddy" } func runDev(ctx context.Context, args []string) error {