
This just brings over the whitespace linter and updates any files that may have been out of compliance. It's also a small update to .gitignore to not care about the .out files generated by a make cover command. Change-Id: I3e5a4f170f0fd7724949708a290a1e13def834fb
57 lines
2.3 KiB
Bash
Executable File
57 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -x
|
|
|
|
tools_bin_dir="${BASH_SOURCE%/*}"
|
|
node_version=v12.16.3
|
|
npm_user=${USER:-root}
|
|
|
|
if [[ ! -d $tools_bin_dir/node-$node_version ]]; then
|
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
# Linux
|
|
if ! curl -sfL "https://nodejs.org/dist/$node_version/node-$node_version-linux-x64.tar.gz" | tar zxf - --directory "$tools_bin_dir"; then
|
|
printf "Something went wrong while installing linux-gnu nodejs\n" 1>&2
|
|
exit 1
|
|
else
|
|
mv $tools_bin_dir/node-$node_version-linux-x64 $tools_bin_dir/node-$node_version
|
|
fi
|
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
|
# Mac OSX
|
|
if ! curl -sfL "https://nodejs.org/dist/$node_version/node-$node_version-darwin-x64.tar.gz" | tar zxf - --directory "$tools_bin_dir"; then
|
|
printf "Something went wrong while installing Mac OSX nodejs\n" 1>&2
|
|
exit 1
|
|
else
|
|
mv $tools_bin_dir/node-$node_version-darwin-x64 $tools_bin_dir/node-$node_version
|
|
fi
|
|
elif [[ "$OSTYPE" == "cygwin" ]]; then
|
|
# Windows
|
|
if ! wget -qO- https://nodejs.org/dist/$node_version/node-$node_version-win-x64.zip | bsdtar -xf- -C tools; then
|
|
printf "Something went wrong while installing Windows nodejs\n" 1>&2
|
|
exit 1
|
|
else
|
|
mv $tools_bin_dir/node-$node_version-win-x64 $tools_bin_dir/node-$node_version
|
|
# the windows install doesn't conform to the same directory structure so making it conform
|
|
mkdir $tools_bin_dir/node-$node_version/bin
|
|
mv $tools_bin_dir/node-$node_version/n* $tools_bin_dir/node-$node_version/bin
|
|
chmod -R a+x $tools_bin_dir/node-$node_version/bin
|
|
fi
|
|
fi
|
|
|
|
# npm requires node to also be on the path
|
|
export PATH=$(realpath $tools_bin_dir)/node-$node_version/bin:$PATH
|
|
|
|
# Proxy / SSL issues when using custom CAs with proxy / self signed certs.
|
|
# This assumes the system certs are up to date and is on linux or in docker
|
|
if [ -r /etc/ssl/certs/ca-certificates.crt ]; then
|
|
export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
|
|
fi
|
|
|
|
# npm will write to a node_modules even with the --directory flag it's better to be in the root of where you want this to live
|
|
cd web
|
|
npm config set user ${npm_user}
|
|
if ! npm install eslint-plugin-html@latest --save-dev; then
|
|
printf "Something went wrong while installing eslint-plugin-html\n" 1>&2
|
|
exit 1
|
|
fi
|
|
cd ..
|
|
fi
|