Skip to content
Snippets Groups Projects
Commit 1f702d19 authored by Bob Mottram's avatar Bob Mottram
Browse files

Test nodejs version numbers

parent 4a04d291
No related branches found
No related tags found
No related merge requests found
......@@ -127,6 +127,28 @@ function mesh_install_nodejs {
$mesh_install_nodejs_prefix npm install --arch=$NPM_ARCH -g n@${NODEJS_N_VERSION} --save
$mesh_install_nodejs_prefix n --arch $N_ARCH ${NODEJS_VERSION}
cp $rootdir/root/npm $rootdir/usr/bin/npm
# check the version numbers
cat <<EOF > $rootdir/usr/bin/test_nodejs_install
#!/bin/bash
node_version=\$(node -v)
if [[ "\$node_version" != "v${NODEJS_VERSION}" ]]; then
echo $"nodejs version expected to be ${NODEJS_VERSION} but found \$node_version"
exit 1
fi
npm_version=\$(npm -v)
if [[ "\$npm_version" != "v${NPM_VERSION}" ]]; then
echo $"npm version expected to be ${NPM_VERSION} but found \$npm_version"
exit 2
fi
EOF
chmod +x $rootdir/usr/bin/test_nodejs_install
chroot "$rootdir" /usr/bin/test_nodejs_install
if [ ! "$?" = "0" ]; then
echo $"nodejs version numbers did not match. Architecture is $NPM_ARCH."
exit 76835282
fi
rm $rootdir/usr/bin/test_nodejs_install
}
function remove_nodejs {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment