mirror of
				https://github.com/traefik/traefik.git
				synced 2025-11-04 02:11:15 +01:00 
			
		
		
		
	… instead of /bin/bash, to work better on more platforms. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
		
			
				
	
	
		
			38 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
set -o errexit
 | 
						|
set -o pipefail
 | 
						|
set -o nounset
 | 
						|
 | 
						|
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; export SCRIPTDIR
 | 
						|
source "${SCRIPTDIR}/.validate"
 | 
						|
 | 
						|
# Iterate over all directories containing vendor folders.
 | 
						|
for dir in . integration; do
 | 
						|
	vendor_dir="${dir}/vendor/"
 | 
						|
	IFS=$'\n' files=( $(validate_diff --diff-filter=ACMR --name-only -- ${vendor_dir} || true) )
 | 
						|
 | 
						|
	if [[ ${#files[@]} -gt 0 ]]; then
 | 
						|
		# We run glide install to and see if we have a diff afterwards
 | 
						|
		echo "checking ${vendor_dir} for unintentional changes..."
 | 
						|
		(
 | 
						|
		cd ${dir}
 | 
						|
		"${SCRIPTDIR}/glide.sh" install
 | 
						|
		)
 | 
						|
		# Let see if the working directory is clean
 | 
						|
		diffs="$(git status --porcelain -- ${vendor_dir} 2>/dev/null)"
 | 
						|
		if [[ "$diffs" ]]; then
 | 
						|
			{
 | 
						|
				echo "The result of 'glide install' for vendor directory '${dir}' differs"
 | 
						|
				echo
 | 
						|
				echo "$diffs"
 | 
						|
				echo
 | 
						|
				echo 'Please vendor your package(s) with script/glide.sh.'
 | 
						|
				echo
 | 
						|
			} >&2
 | 
						|
			exit 2
 | 
						|
		fi
 | 
						|
	fi
 | 
						|
done
 | 
						|
 | 
						|
echo 'Congratulations! All vendoring changes are done the right way.'
 |