1
0
mirror of https://github.com/containous/traefik.git synced 2024-12-23 17:34:13 +03:00
traefik/script/validate-vendor

30 lines
773 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
2018-01-11 19:46:04 +03:00
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; export SCRIPT_DIR
vendor_dir="./vendor/"
2019-04-01 16:30:07 +03:00
# We run dep install to and see if we have a diff afterwards
echo "checking ${vendor_dir} for unintentional changes..."
2018-01-11 19:46:04 +03:00
2019-04-01 16:30:07 +03:00
dep ensure -v
(${SCRIPT_DIR}/prune-dep.sh)
2018-01-11 19:46:04 +03:00
2019-04-01 16:30:07 +03:00
# Let see if the working directory is clean
diffs="$(git status --porcelain -- ${vendor_dir} 2>/dev/null)"
if [[ "$diffs" ]]; then
{
echo "The result of 'dep ensure' for vendor directory '${vendor_dir}' differs"
echo
echo "$diffs"
echo
echo 'Please vendor your package(s) with dep.'
echo
} >&2
exit 2
fi
echo 'Congratulations! All vendoring changes are done the right way.'