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

Improve handling of npm install script

parent 283c470d
No related branches found
No related tags found
No related merge requests found
......@@ -85,13 +85,17 @@ function mesh_install_nodejs {
exit 7235728
fi
wget https://www.npmjs.com/install.sh -O $rootdir/root/npm_install.sh
$mesh_install_nodejs_prefix wget https://www.npmjs.com/install.sh -O /root/npm_install.sh
if [ ! -f $rootdir/root/npm_install.sh ]; then
echo $'Unable to download npm installer'
exit 8793636
fi
if ! grep -q "t=\"\${npm_install}\"" $rootdir/root/npm_install.sh; then
echo $'Unable to set npm version within npm_install.sh'
exit 629052
fi
$mesh_install_nodejs_prefix chmod +x /root/npm_install.sh
sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" $rootdir/root/npm_install.sh
$mesh_install_nodejs_prefix sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" /root/npm_install.sh
$mesh_install_nodejs_prefix /root/npm_install.sh
if [ ! -f $rootdir/usr/bin/npm ]; then
......
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