Don't always install node in the virtualenv

if it's already installed system-wide at the correct version.

Prevent node installation issues during CI builds where we install
node with the setup-node action but it was ignored because it was
not inside the virtualenv, e.g.:

https://github.com/galaxyproject/galaxy/actions/runs/5530959878/jobs/10091018774
This commit is contained in:
Nicola Soranzo
2023-07-12 19:26:02 +01:00
parent eb36c377f6
commit 62497462e0
+1 -1
View File
@@ -199,7 +199,7 @@ fi
# Install node if not installed
if [ -n "$VIRTUAL_ENV" ]; then
if ! in_venv "$(command -v node)" || [ "$(node --version)" != "v${NODE_VERSION}" ]; then
if ! command -v node >/dev/null || [ "$(node --version)" != "v${NODE_VERSION}" ]; then
echo "Installing node into $VIRTUAL_ENV with nodeenv."
if [ -d "${VIRTUAL_ENV}/lib/node_modules" ]; then
echo "Removing old ${VIRTUAL_ENV}/lib/node_modules directory."