diff --git a/Makefile b/Makefile index 9da38ff7..566471b2 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,9 @@ generate-all: done mod: - rm -f go.mod go.sum ${PACKAGE_PREFIX}/${PACKAGE_MAJOR}/go.mod ${PACKAGE_PREFIX}/${PACKAGE_MAJOR}/go.sum + for goModOrSum in $(shell set -x; find . -not \( -path ./examples -prune \) -name go.mod -o -name go.sum | sort -n); do \ + rm -f $$goModOrSum;\ + done ${GO_CMD} go mod init github.com/${GIT_ORG}/${GIT_REPO} ${GO_CMD} go mod tidy diff --git a/Makefile.metalv1 b/Makefile.metalv1 index 390c7264..72258acd 100644 --- a/Makefile.metalv1 +++ b/Makefile.metalv1 @@ -14,7 +14,7 @@ SPEC_PATCHED_DIR=${SPEC_BASE_DIR}/${PACKAGE_NAME}/oas3.patched all: pull fetch patch generate stage -generate: clean codegen remove-unused mod patch-post fmt test +generate: clean codegen remove-unused patch-post fmt mod test pull: ${CRI} pull ${OPENAPI_IMAGE} @@ -60,6 +60,4 @@ remove-unused: rm -rf ${CODE_DIR}/api \ ${CODE_DIR}/.travis.yml \ ${CODE_DIR}/git_push.sh \ - ${CODE_DIR}/.openapi-generator \ - ${CODE_DIR}/go.mod \ - ${CODE_DIR}/go.sum + ${CODE_DIR}/.openapi-generator diff --git a/templates/Makefile.sdk b/templates/Makefile.sdk index ad0979e5..6a6e5568 100644 --- a/templates/Makefile.sdk +++ b/templates/Makefile.sdk @@ -14,7 +14,7 @@ SPEC_PATCHED_DIR=${SPEC_BASE_DIR}/${PACKAGE_NAME}/oas3.patched all: pull fetch patch generate stage -generate: clean codegen remove-unused mod patch-post fmt test +generate: clean codegen remove-unused patch-post mod fmt test pull: ${CRI} pull ${OPENAPI_IMAGE} @@ -60,6 +60,4 @@ remove-unused: rm -rf ${CODE_DIR}/api \ ${CODE_DIR}/.travis.yml \ ${CODE_DIR}/git_push.sh \ - ${CODE_DIR}/.openapi-generator \ - ${CODE_DIR}/go.mod \ - ${CODE_DIR}/go.sum + ${CODE_DIR}/.openapi-generator