Skip to content

Commit

Permalink
simplify absolute path xcaddy
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevsr authored Jan 1, 2025
1 parent 56c9e08 commit 3d5c681
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions build-static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,10 @@ if ! type "go" >/dev/null 2>&1; then
exit 1
fi

if ! type "xcaddy" >/dev/null 2>&1; then
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
fi

if ! type "xcaddy" >/dev/null 2>&1; then
echo "Something went wrong after running \"go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest\"."

PATH_USER_DOWNLOAD_GO="$(go env GOPATH)/bin"
XCADDY_COMMAND="$(go env GOPATH)/bin/xcaddy"

# Default shell support
if [ -z "$PATH_USER_DOWNLOAD_GO" ]; then
echo "We cannot detection location user-downloads package in Go"
exit 1
fi

echo "Your user-downloads package in Go = ${PATH_USER_DOWNLOAD_GO}"
exit 1
if ! type "$XCADDY_COMMAND" >/dev/null 2>&1; then
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
fi

curlGitHubHeaders=(--header "X-GitHub-Api-Version: 2022-11-28")
Expand Down Expand Up @@ -316,7 +303,7 @@ cd caddy/
CGO_ENABLED=1 \
XCADDY_GO_BUILD_FLAGS="-buildmode=pie -tags cgo,netgo,osusergo,static_build,nobadger,nomysql,nopgx -ldflags \"-linkmode=external -extldflags '-static-pie ${extraExtldflags}' ${extraLdflags} -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ${FRANKENPHP_VERSION} PHP ${LIBPHP_VERSION} Caddy'\"" \
XCADDY_DEBUG="${XCADDY_DEBUG}" \
xcaddy build \
${XCADDY_COMMAND} build \
--output "../dist/${bin}" \
${XCADDY_ARGS} \
--with github.com/dunglas/frankenphp=.. \
Expand Down

0 comments on commit 3d5c681

Please sign in to comment.