setup-node/__tests__/verify-node-version.sh

13 lines
248 B
Bash
Raw Normal View History

2020-01-25 00:12:20 +08:00
#!/bin/sh
2020-01-25 00:28:26 +08:00
if [ -z "$1" ]; then
2020-01-25 00:12:20 +08:00
echo "Must supply version argument"
exit 1
fi
node_version="$(node --version)"
echo "Found node version '$node_version'"
2020-01-25 00:28:26 +08:00
if [ -z "$(echo $node_version | grep v$1)" ]; then
2020-01-25 00:12:20 +08:00
echo "Unexpected version"
exit 1
fi