-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefile: build completion scripts as part of (dyn)binary
Build the (cobra) generated completion scripts when building the binaries, and store them inside build/completions. Signed-off-by: Sebastiaan van Stijn <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env sh | ||
# | ||
# Build the shell completion scripts | ||
# | ||
|
||
set -eu | ||
|
||
. ./scripts/build/.variables | ||
|
||
# generate the shell completion scripts and store them in build/completion. | ||
if [ "$(go env GOOS)" != "windows" ]; then | ||
if [ ! -f ./build/docker ]; then | ||
echo "Run 'make binary' or 'make dynbinary' first" | ||
fi | ||
|
||
./build/docker completion bash | install -D /dev/stdin build/completion/bash/docker | ||
./build/docker completion zsh | install -D /dev/stdin build/completion/zsh/_docker | ||
./build/docker completion fish | install -D /dev/stdin build/completion/fish/docker.fish | ||
fi |