Skip to content

Commit

Permalink
Makefile: add "shell-completion" target
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Jan 23, 2025
1 parent 485bc7d commit 6e49d17
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ fmt: ## run gofumpt (if present) or gofmt
.PHONY: binary
binary: ## build executable for Linux
./scripts/build/binary
./scripts/build/completion

.PHONY: dynbinary
dynbinary: ## build dynamically linked binary
GO_LINKMODE=dynamic ./scripts/build/binary
./scripts/build/completion

.PHONY: plugins
plugins: ## build example CLI plugins
Expand All @@ -89,8 +87,8 @@ authors: ## generate AUTHORS file from git history
scripts/docs/generate-authors.sh

.PHONY: completion
completion: binary
completion: ## generate and install the completion scripts
completion: shell-completion
completion: ## generate and install the shell-completion scripts
# Note: this uses system-wide paths, and so may overwrite completion
# scripts installed as part of deb/rpm packages.
#
Expand All @@ -103,6 +101,14 @@ completion: ## generate and install the completion scripts
install -D -p -m 0644 ./build/completion/fish/docker.fish debian/docker-ce-cli/usr/share/fish/vendor_completions.d/docker.fish
install -D -p -m 0644 ./build/completion/zsh/_docker debian/docker-ce-cli/usr/share/zsh/vendor-completions/_docker

.PHONY: shell-completion
shell-completion: ## generate shell-completion scripts
# requires either "binary" or "dynbinary" to be built.
# but only build if it's not there, to prevent existing binaries
# from being replaced.
@ [ -f build/docker ] || $(MAKE) binary
@ ./scripts/build/completion

.PHONY: manpages
manpages: ## generate man pages from go source and markdown
scripts/docs/generate-man.sh
Expand Down

0 comments on commit 6e49d17

Please sign in to comment.