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

13 lines
248 B
Bash
Raw Normal View History

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