Some checks failed
DCO action / DCO (pull_request) Failing after 5m11s
Tests and linters / Staticcheck (pull_request) Failing after 5m3s
Vulncheck / Vulncheck (pull_request) Failing after 5m7s
Build / Build Components (1.21) (pull_request) Failing after 5m52s
Build / Build Components (1.20) (pull_request) Failing after 6m6s
Tests and linters / Lint (pull_request) Failing after 6m43s
Tests and linters / Tests (1.21) (pull_request) Failing after 8m1s
Tests and linters / Tests (1.20) (pull_request) Failing after 8m16s
Tests and linters / Tests with -race (pull_request) Failing after 8m17s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
27 lines
640 B
Bash
Executable file
27 lines
640 B
Bash
Executable file
#!/bin/bash
|
|
|
|
FROM="$1"
|
|
OLD_FILE="$(mktemp)"
|
|
NEW_FILE="$(mktemp)"
|
|
|
|
declare -A old
|
|
git show "$FROM:go.mod" \
|
|
| sed -n -e '6 { /require/ b x; :x { p; n; /)/ q; b x} }' > "$OLD_FILE"
|
|
while IFS= read -r line; do
|
|
x=( $line )
|
|
old[${x[0]}]=${x[1]}
|
|
done < "$OLD_FILE"
|
|
|
|
declare -A new
|
|
cat go.mod \
|
|
| sed -n -e '6 { /require/ b x; :x { p; n; /)/ q; b x} }' > "$NEW_FILE"
|
|
while IFS= read -r line; do
|
|
x=( $line )
|
|
new[${x[0]}]=${x[1]}
|
|
done < "$NEW_FILE"
|
|
|
|
for index in ${!new[@]}; do
|
|
if [[ -n $old[$index] ]] && [[ ${old[$index]} != ${new[$index]} ]]; then
|
|
echo "- \`$index\` from ${old[$index]} to ${new[$index]}"
|
|
fi
|
|
done
|