print current go and node versions in version check script

This commit is contained in:
Pratham Jagga 2024-11-03 16:37:34 +05:30
parent fa9bb2d402
commit b35400bccb
No known key found for this signature in database
GPG key ID: 780AF757269CE728

View file

@ -5,7 +5,9 @@ MIN_NODE_VERSION=$(cat web/ui/.nvmrc | tr -d '\r' | sed 's/v//')
MIN_GO_VERSION=$(awk '/^go / {print $2}' go.mod)
# Check Nodejs version.
echo -n "CURRENT NODE VERSION " && node --version
[ "$(echo -e "$(node --version)\n$MIN_NODE_VERSION" | sort -V | head -n 1)" = "$MIN_NODE_VERSION" ] && echo "Nodejs version OK" || echo "Warning: Installed Node.js version is less than the required version $MIN_NODE_VERSION"
# Check Go version.
echo -n "CURRENT GO VERSION " && go version | awk '{print $3}'
[ "$(echo -e "$(go version | awk '{print $3}')\n$MIN_GO_VERSION" | sort -V | head -n 1)" = "$MIN_GO_VERSION" ] && echo "Go version OK" || echo "Warning: Installed Go version is less than the required version $MIN_GO_VERSION"