From c6a54d12295d3b436cca1ce1d04af7baee2f4bbd Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Fri, 10 Jan 2025 17:36:03 +0100 Subject: [PATCH] improve script compatibility (#4132) --- scripts/apidocs.mk | 2 +- scripts/format.mk | 2 +- scripts/lint.mk | 4 ++-- scripts/mod-tidy.mk | 2 +- scripts/test.mk | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/apidocs.mk b/scripts/apidocs.mk index 1ad5646d..95ad089f 100644 --- a/scripts/apidocs.mk +++ b/scripts/apidocs.mk @@ -6,5 +6,5 @@ export DOCKERFILE_APIDOCS_GEN apidocs: echo "$$DOCKERFILE_APIDOCS_GEN" | docker build . -f - -t temp - docker run --rm -v "$(PWD)/apidocs:/s" -w /s temp \ + docker run --rm -v "$(shell pwd)/apidocs:/s" -w /s temp \ sh -c "redoc-cli bundle openapi.yaml" diff --git a/scripts/format.mk b/scripts/format.mk index 06bdf985..dae932b2 100644 --- a/scripts/format.mk +++ b/scripts/format.mk @@ -6,5 +6,5 @@ export DOCKERFILE_FORMAT format: echo "$$DOCKERFILE_FORMAT" | docker build -q . -f - -t temp - docker run --rm -it -v "$(PWD):/s" -w /s temp \ + docker run --rm -it -v "$(shell pwd):/s" -w /s temp \ sh -c "gofumpt -l -w ." diff --git a/scripts/lint.mk b/scripts/lint.mk index ea268a2d..bf91bb79 100644 --- a/scripts/lint.mk +++ b/scripts/lint.mk @@ -5,7 +5,7 @@ endef export DOCKERFILE_APIDOCS_LINT lint-golangci: - docker run --rm -v "$(PWD):/app" -w /app \ + docker run --rm -v "$(shell pwd):/app" -w /app \ $(LINT_IMAGE) \ golangci-lint run -v @@ -15,7 +15,7 @@ lint-mod-tidy: lint-apidocs: echo "$$DOCKERFILE_APIDOCS_LINT" | docker build . -f - -t temp - docker run --rm -v "$(PWD)/apidocs:/s" -w /s temp \ + docker run --rm -v "$(shell pwd)/apidocs:/s" -w /s temp \ sh -c "openapi lint openapi.yaml" lint: lint-golangci lint-mod-tidy lint-apidocs diff --git a/scripts/mod-tidy.mk b/scripts/mod-tidy.mk index e2cb4f16..7a336fc4 100644 --- a/scripts/mod-tidy.mk +++ b/scripts/mod-tidy.mk @@ -1,3 +1,3 @@ mod-tidy: - docker run --rm -it -v "$(PWD):/s" -w /s $(BASE_IMAGE) \ + docker run --rm -it -v "$(shell pwd):/s" -w /s $(BASE_IMAGE) \ sh -c "apk add git && GOPROXY=direct go mod tidy" diff --git a/scripts/test.mk b/scripts/test.mk index 6876eae2..497c50f5 100644 --- a/scripts/test.mk +++ b/scripts/test.mk @@ -25,13 +25,13 @@ export DOCKERFILE_TEST test: echo "$$DOCKERFILE_TEST" | docker build -q . -f - -t temp --build-arg ARCH=amd64 docker run --rm \ - -v "$(PWD):/s" \ + -v "$(shell pwd):/s" \ temp \ make test-nodocker test32: echo "$$DOCKERFILE_TEST" | docker build -q . -f - -t temp --build-arg ARCH=i386 docker run --rm \ - -v "$(PWD):/s" \ + -v "$(shell pwd):/s" \ temp \ make test-nodocker