Update readme, specify local binary when executing

This commit is contained in:
Matthew Holt 2020-12-28 08:49:32 -07:00
parent 4f3e0ef756
commit f74ee60bd8
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
2 changed files with 10 additions and 1 deletions

View file

@ -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`.

View file

@ -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 {