github.com/duglin/docker@v1.13.1/hack/validate/compose-bindata (about)

     1  #!/bin/bash
     2  
     3  export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
     4  source "${SCRIPTDIR}/.validate"
     5  
     6  IFS=$'\n'
     7  files=( $(validate_diff --diff-filter=ACMR --name-only -- 'cli/compose/schema/data' || true) )
     8  unset IFS
     9  
    10  if [ ${#files[@]} -gt 0 ]; then
    11  	go generate github.com/docker/docker/cli/compose/schema 2> /dev/null
    12  	# Let see if the working directory is clean
    13  	diffs="$(git status --porcelain -- cli/compose/schema 2>/dev/null)"
    14  	if [ "$diffs" ]; then
    15  		{
    16  			echo 'The result of `go generate github.com/docker/docker/cli/compose/schema` differs'
    17  			echo
    18  			echo "$diffs"
    19  			echo
    20  			echo 'Please run `go generate github.com/docker/docker/cli/compose/schema`'
    21  		} >&2
    22  		false
    23  	else
    24  		echo 'Congratulations! cli/compose/schema/bindata.go is up-to-date.'
    25  	fi
    26  else
    27      echo 'No cli/compose/schema/data changes in diff.'
    28  fi