github.com/adityamillind98/moby@v23.0.0-rc.4+incompatible/hack/vendor.sh (about)

     1  #!/usr/bin/env bash
     2  #
     3  # This file is just a wrapper around the 'go mod vendor' tool.
     4  # For updating dependencies you should change `vendor.mod` file in root of the
     5  # project.
     6  
     7  set -e
     8  
     9  SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
    10  
    11  tidy() (
    12  		set -x
    13  		"${SCRIPTDIR}"/with-go-mod.sh go mod tidy -modfile vendor.mod -compat 1.18
    14  )
    15  
    16  vendor() (
    17  		set -x
    18  		"${SCRIPTDIR}"/with-go-mod.sh go mod vendor -modfile vendor.mod
    19  )
    20  
    21  help() {
    22  	printf "%s:\n" "$(basename "$0")"
    23  	echo "  - tidy: run go mod tidy"
    24  	echo "  - vendor: run go mod vendor"
    25  	echo "  - all: run tidy && vendor"
    26  	echo "  - help: show this help"
    27  }
    28  
    29  case "$1" in
    30  	tidy) tidy ;;
    31  	vendor) vendor ;;
    32  	""|all) tidy && vendor ;;
    33  	*) help ;;
    34  esac