Check multiple possible nodes

This commit is contained in:
Bob Mottram 2017-10-13 20:50:21 +01:00
parent be43cf38a3
commit c23cd4aee5
1 changed files with 13 additions and 4 deletions

View File

@ -98,16 +98,25 @@ function mesh_install_nodejs {
fi
$mesh_install_nodejs_prefix apt-get -yq install nodejs
if [ ! -f ${rootdir}/usr/bin/nodejs ]; then
echo $'nodejs was not installed'
exit 63962
CURR_NODE_VERSION=$(node --version)
if [[ "$CURR_NODE_VERSION" != "v${NODEJS_VERSION}" ]]; then
echo $"Expected node version $NODEJS_VERSION but actually have $CURR_NODE_VERSION"
exit 5274527
fi
if [ -f $rootdir/usr/bin/nodejs ]; then
cp $rootdir/usr/bin/nodejs $rootdir/usr/bin/node
fi
if [ ! -f ${rootdir}/usr/bin/node ]; then
if [ ! -f ${rootdir}/usr/local/bin/node ]; then
if [ ! -f ${rootdir}/usr/bin/nodejs ]; then
echo $'nodejs was not installed'
exit 63962
fi
fi
fi
if [ ! -f $rootdir/usr/bin/node ]; then
echo $'/usr/bin/node not found'
exit 7235728