2022-06-24 20:19:51 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-06-24 20:11:21 +00:00
|
|
|
|
|
|
|
if [ ! -d "gui" ]; then
|
|
|
|
echo "Error: Run this script from the main FreeDATA directory."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Move into gui directory
|
|
|
|
cd gui
|
|
|
|
|
|
|
|
# Common variables
|
|
|
|
OLDPATH=${PATH}
|
|
|
|
PATH=/usr/bin:/bin:/usr/local/bin
|
2022-06-24 20:19:51 +00:00
|
|
|
NPM=$(which npm)
|
2022-06-24 20:11:21 +00:00
|
|
|
PATH=${OLDPATH}
|
2022-06-24 20:19:51 +00:00
|
|
|
VENVDIR="$(pwd)/node_modules"
|
|
|
|
PATH_ADDITIONS="$(pwd)/node_modules/bin:$(pwd)/node_modules/.bin"
|
2022-06-24 20:11:21 +00:00
|
|
|
|
|
|
|
# Verify NPM exists.
|
2022-06-24 20:17:44 +00:00
|
|
|
if [ -z "${NPM}" ] || [ ! -x "${NPM}" ]; then
|
2022-06-24 20:11:21 +00:00
|
|
|
echo "Error: ${NPM} isn't executable or doesn't exist."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
${NPM} install n
|
|
|
|
${NPM} i
|
|
|
|
|
|
|
|
PATH=${PATH_ADDITIONS}:${PATH}
|
|
|
|
|
|
|
|
n stable
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Be sure to add '$PATH_ADDITIONS' to your path."
|