From 3528d280b96c8c79525fcf5a5c39426d65d87dd0 Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Wed, 13 Jan 2021 17:39:44 +0100 Subject: [PATCH] Move main.go to root directory, so one can install hub-tool using go install Signed-off-by: Silvin Lubecki --- README.md | 4 ++++ builder.Makefile | 12 ++++++------ cmd/hub-tool/main.go => main.go | 0 3 files changed, 10 insertions(+), 6 deletions(-) rename cmd/hub-tool/main.go => main.go (100%) diff --git a/README.md b/README.md index 2bb9b9d..446bdba 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ perform Hub maintenance tasks. [here](https://github.com/docker/hub-tool/releases) - Extract the package and place the `hub-tool` binary somewhere in your `PATH` +OR + +- Install from sources: `go install github.com/docker/hub-tool` + ### Login to Docker Hub Login to the [Docker Hub](https://hub.docker.com) using your username and diff --git a/builder.Makefile b/builder.Makefile index 145a9fe..2ee065e 100644 --- a/builder.Makefile +++ b/builder.Makefile @@ -57,18 +57,18 @@ test-unit: .PHONY:cross cross: - GOOS=linux GOARCH=amd64 $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_linux_amd64 ./cmd/$(BINARY_NAME) - GOOS=linux GOARCH=arm64 $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_linux_arm64 ./cmd/$(BINARY_NAME) - GOOS=linux GOARCH=arm $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_linux_arm ./cmd/$(BINARY_NAME) - GOOS=darwin GOARCH=amd64 $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_darwin_amd64 ./cmd/$(BINARY_NAME) - GOOS=windows GOARCH=amd64 $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_windows_amd64.exe ./cmd/$(BINARY_NAME) + GOOS=linux GOARCH=amd64 $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_linux_amd64 . + GOOS=linux GOARCH=arm64 $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_linux_arm64 . + GOOS=linux GOARCH=arm $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_linux_arm . + GOOS=darwin GOARCH=amd64 $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_darwin_amd64 . + GOOS=windows GOARCH=amd64 $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(BINARY_NAME)_windows_amd64.exe . # Note we're building statically for now to simplify releases. We can # investigate dynamic builds later. .PHONY: build build: mkdir -p bin - $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(PLATFORM_BINARY) ./cmd/$(BINARY_NAME) + $(STATIC_FLAGS) $(GO_BUILD) -o bin/$(PLATFORM_BINARY) . cp bin/$(PLATFORM_BINARY) bin/$(BINARY) .PHONY: package diff --git a/cmd/hub-tool/main.go b/main.go similarity index 100% rename from cmd/hub-tool/main.go rename to main.go