check_deps: fix the check for stable NeoGo revisions used in nft-nd-nns

vX.Y.Z-date-commit is very much different from vX.Y.Z and we can have any of
them for NeoGo (vX.Y.Z is even preferable). Previous code ended up this way
for v0.106.3:

++ sed -E -n -e 's/.*neo-go\s.+-.+-(\w+)/\1/ p' examples/nft-nd-nns//go.mod
+ NEO_GO_COMMIT=
+ git merge-base --is-ancestor '' HEAD
fatal: Not a valid object name
+ die 'examples/nft-nd-nns/: neo-go commit  was not found in git'
+ echo 'examples/nft-nd-nns/: neo-go commit  was not found in git'
examples/nft-nd-nns/: neo-go commit  was not found in git
+ exit 1

Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
Roman Khimov 2024-09-04 11:01:17 +03:00
parent f614cc3d45
commit 09921bb3a4

View file

@ -26,6 +26,9 @@ for dir in examples/*/; do
if [ -z "${dir#*nft-nd-nns/}" ]; then
NEO_GO_COMMIT="$(sed -E -n -e 's/.*neo-go\s.+-.+-(\w+)/\1/ p' "$dir/go.mod")"
if [ -z "$NEO_GO_COMMIT" ]; then
NEO_GO_COMMIT="$(sed -E -n -e 's/.*neo-go\s(\w+)/\1/ p' "$dir/go.mod")"
fi
git merge-base --is-ancestor "$NEO_GO_COMMIT" HEAD ||
die "$dir: neo-go commit $NEO_GO_COMMIT was not found in git"
fi