Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ Because the subcommands and flags are constrained to benefit rapid plugin protot
- `XCADDY_WHICH_GO` sets the go command to use when for example more then 1 version of go is installed.
- `XCADDY_GO_BUILD_FLAGS` overrides default build arguments. Supports Unix-style shell quoting, for example: XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'". The provided flags are applied to `go` commands: build, clean, get, install, list, run, and test
- `XCADDY_GO_MOD_FLAGS` overrides default `go mod` arguments. Supports Unix-style shell quoting.
- `XCADDY_PRINT_VERSION` prints the Caddy version after building to prove the build is working (defaults to 1).

---

Expand Down
4 changes: 3 additions & 1 deletion cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ Flags:
return err
}

var printVersion = os.Getenv("XCADDY_PRINT_VERSION") != "0"

// prove the build is working by printing the version
if runtime.GOOS == utils.GetGOOS() && runtime.GOARCH == utils.GetGOARCH() {
if printVersion && runtime.GOOS == utils.GetGOOS() && runtime.GOARCH == utils.GetGOARCH() {
if !filepath.IsAbs(output) {
output = "." + string(filepath.Separator) + output
}
Expand Down