mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-05 13:47:10 +02:00
This helps reduce confusion when UI-related targets fail without directly indicating a version mismatch. Automatically runs during UI builds and tests. The check is only indicative. The "go" binary can hard stop and print relevant messages on its own for mismatches, thus not covered here. supersedes https://github.com/prometheus/prometheus/pull/15106 Signed-off-by: machine424 <ayoubmrini424@gmail.com> Co-authored-by: Pratham <prathamjagga123@gmail.com>
12 lines
420 B
Bash
Executable File
12 lines
420 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
YELLOW='\033[0;33m'
|
|
NC='\033[0m'
|
|
|
|
MIN_NODE_VERSION=$(cat web/ui/.nvmrc | sed 's/v//')
|
|
CURRENT_NODE_VERSION=$(node --version | sed 's/v//')
|
|
|
|
if [ "$(echo -e "$CURRENT_NODE_VERSION\n$MIN_NODE_VERSION" | sort -V | head -n 1)" != "$MIN_NODE_VERSION" ]; then
|
|
printf "${YELLOW}Warning:${NC}: Node.js version mismatch! Required minimum: $MIN_NODE_VERSION Installed version: $CURRENT_NODE_VERSION\n"
|
|
fi
|