9db221c84f
Once #106152 lands, nodejs will be available on our trusty build nodes, so nodeenv is no longer strictly required. However, not everyone wants to install nodejs on their system, so we now wrap the nodeenv invocation into a script to test whether a local node exists. Since we can no longer assume the existence of a clean virtual environment, we also no longer install a global version of bower and grunt, and instead use the versions bundled with the codebase's package.json. Change-Id: I42f4b61037b8e988708b39e951dd2cddd99313b0
22 lines
358 B
Bash
22 lines
358 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# This script checks if node is installed in the current path,
|
|
# and if not, will install the version specified. using nodeenv -p
|
|
#
|
|
#command -v node && echo "ok"
|
|
|
|
ENVDIR="$1"
|
|
VERSION="$2"
|
|
|
|
if [[ $(command -v node) ]]
|
|
then
|
|
exit
|
|
fi
|
|
|
|
if [[ -n "$VERSION" ]]
|
|
then
|
|
nodeenv -p "$ENVDIR" --node="$VERSION"
|
|
else
|
|
nodeenv -p "$ENVDIR"
|
|
fi |