Add a target to build the (cobra) generated completion and store them inside build/completions. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
22 lines
600 B
Bash
Executable File
22 lines
600 B
Bash
Executable File
#!/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"
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p build/completion/bash build/completion/fish build/completion/zsh
|
|
./build/docker completion bash > build/completion/bash/docker
|
|
./build/docker completion fish > build/completion/fish/docker.fish
|
|
./build/docker completion zsh > build/completion/zsh/_docker
|
|
fi
|