From f179f0131491e11b33e762a76938ed6ebce40214 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 10 Dec 2020 14:07:08 -0800 Subject: [PATCH] Modify struct-markdown generator code to work from different projct roots Modify makefile to call generate code properly, setting project root. 'make generate' now avoids deleting website code generated in the packer plugin sdk. For now it will be maintainers' responsibility to regenerate this docs code from the packer plugin sdk every release, and commit it to these folders manually. remove boot command generator code --- Makefile | 21 ++++----------------- cmd/struct-markdown/main.go | 14 +++++++++++--- main.go | 1 - 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 87f0829d9..8ed1251cd 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,6 @@ install-gen-deps: ## Install dependencies for code generation # out code dependencies; so a go mod tidy will remove them again. `go # install` seems to install the last tagged version and we want to install # master. - @(cd $(TEMPDIR) && GO111MODULE=on go get github.com/mna/pigeon@master) @(cd $(TEMPDIR) && GO111MODULE=on go get github.com/alvaroloes/enumer@master) @go install ./cmd/struct-markdown @go install ./cmd/mapstructure-to-hcl2 @@ -66,16 +65,6 @@ install-lint-deps: ## Install linter dependencies @echo "==> Updating linter dependencies..." @curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.23.8 -dev: ## Build and install a development build - @grep 'const VersionPrerelease = ""' version/version.go > /dev/null ; if [ $$? -eq 0 ]; then \ - echo "ERROR: You must add prerelease tags to version/version.go prior to making a dev build."; \ - exit 1; \ - fi - @mkdir -p pkg/$(GOOS)_$(GOARCH) - @mkdir -p bin - @go install -ldflags '$(GOLDFLAGS)' - @cp $(GOPATH)/bin/packer bin/packer - @cp $(GOPATH)/bin/packer pkg/$(GOOS)_$(GOARCH) lint: install-lint-deps ## Lint Go code @if [ ! -z $(PKG_NAME) ]; then \ @@ -120,13 +109,11 @@ fmt-examples: # generate runs `go generate` to build the dynamically generated # source files. generate: install-gen-deps ## Generate dynamically generated code - @echo "==> removing autogenerated markdown..." - @find website/pages/ -type f | xargs grep -l '^