diff --git a/scripts/docs/generate-man.sh b/scripts/docs/generate-man.sh index 299c422321..136ed1e000 100755 --- a/scripts/docs/generate-man.sh +++ b/scripts/docs/generate-man.sh @@ -4,8 +4,10 @@ set -eu -o pipefail mkdir -p ./man/man1 -# yay, go install creates a binary named "v2" ¯\_(ツ)_/¯ -go build -o "/go/bin/md2man" ./vendor/github.com/cpuguy83/go-md2man/v2 +if ! command -v md2man &> /dev/null; then + # yay, go install creates a binary named "v2" ¯\_(ツ)_/¯ + go build -o "/go/bin/md2man" ./vendor/github.com/cpuguy83/go-md2man/v2 +fi # Generate man pages from cobra commands go build -o /tmp/gen-manpages github.com/docker/cli/man