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
|
|
|
|
|
2024-04-17 20:49:39 +00:00
|
|
|
# Move into freedata-gui directory
|
|
|
|
cd freedata-gui
|
2022-06-24 20:11:21 +00:00
|
|
|
|
|
|
|
# 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."
|