From 985a4bd730a9496115dc955415ca035b3a96361e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 23 Nov 2022 17:41:39 +0100 Subject: [PATCH] feat: scripts: go.mod dep diff script --- scripts/gomod-diff.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 scripts/gomod-diff.sh diff --git a/scripts/gomod-diff.sh b/scripts/gomod-diff.sh new file mode 100644 index 000000000..b5e863b61 --- /dev/null +++ b/scripts/gomod-diff.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +if [ $# -ne 2 ]; then + echo "./gomod-diff.sh [refA] [refB]" + exit 1 +fi + +temp=$(mktemp -d) +repo=$(pwd) + +cd "$temp" +echo "running in $temp" + +git clone $repo a +git clone $repo b + +cd a +git checkout $1 + +cd ../b +git checkout $2 +make deps +make -j10 buildall + +cd ../a +make deps +make -j10 buildall + +go mod vendor +cd ../b +go mod vendor + +cd .. +diff -r --color a/vendor b/vendor +diff -r --color a/vendor b/vendor > mod.diff +echo "Saved to $temp/mod.diff"