Created
February 14, 2017 23:57
-
-
Save hackebrot/f4609ac55784a9ee2b0f8a8274dcbfe9 to your computer and use it in GitHub Desktop.
gvt fetch for existing project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DEFAULT_GOAL := help | |
define filterstdlib | |
go list -f '{{ if not .Standard }}{{ .ImportPath }}{{ end }}' | |
endef | |
define getimports | |
go list -f '{{ join .Imports "\n" }}' | |
endef | |
.PHONY: fetch | |
fetch: ## Use gvt fetch to vendor dependencies | |
@echo "+ $@" | |
@$(call getimports) | xargs $(call filterstdlib) | xargs -L1 gvt fetch | tee /dev/stderr | |
.PHONY: help | |
help: | |
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment