Skip to content

Commit

Permalink
fix windows artifact package (#193)
Browse files Browse the repository at this point in the history
On Windows, executables can't be run without an executable extension.
Without this change, Trivy downloads the plugin and then is unable to
execute it.
  • Loading branch information
troyready authored Jul 4, 2024
1 parent 894f270 commit 2d83ab9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ build: clean $(OUTPUTS)
GOOS=$(word 1,$(subst /, ,$*)); \
GOARCH=$(word 2,$(subst /, ,$*)); \
CGO_ENABLED=0 GOOS=$$GOOS GOARCH=$$GOARCH go build -ldflags "-s -w" -o trivy-aws-$$GOOS-$$GOARCH ./cmd/trivy-aws/main.go; \
tar -cvzf trivy-aws-$$GOOS-$$GOARCH.tar.gz plugin.yaml trivy-aws-$$GOOS-$$GOARCH LICENSE
if [ $$GOOS = "windows" ]; then \
mv trivy-aws-$$GOOS-$$GOARCH trivy-aws-$$GOOS-$$GOARCH.exe; \
tar -cvzf trivy-aws-$$GOOS-$$GOARCH.tar.gz plugin.yaml trivy-aws-$$GOOS-$$GOARCH.exe LICENSE; \
else \
tar -cvzf trivy-aws-$$GOOS-$$GOARCH.tar.gz plugin.yaml trivy-aws-$$GOOS-$$GOARCH LICENSE; \
fi

.PHONY: test-no-localstack
test-no-localstack:
Expand Down

0 comments on commit 2d83ab9

Please sign in to comment.