Skip to content

Commit

Permalink
Switch dependency_install functions to useing bash source variable
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaSBrown committed Nov 7, 2024
1 parent e7a9f9d commit c3477e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/dependency_install_functions.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
SCRIPT=$(realpath "$0")
SCRIPT=$(realpath "$BASH_SOURCE[0]")
SOURCE=$(dirname "$SCRIPT")
source "${SOURCE}/dependency_versions.sh"
PROJECT_ROOT=$(realpath "${SOURCE}/..")
Expand Down Expand Up @@ -384,12 +384,16 @@ install_node() {

[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
nvm install "$DATAFED_NODE_VERSION"
nvm use "$DATAFED_NODE_VERSION"
# Mark node as installed
touch "${DATAFED_DEPENDENCIES_INSTALL_PATH}/.node_installed-${DATAFED_NODE_VERSION}"
cd "$original_dir"
else
export NVM_DIR="${DATAFED_DEPENDENCIES_INSTALL_PATH}/nvm"
# Used by nvm
export NODE_VERSION="$DATAFED_NODE_VERSION"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
nvm use "$DATAFED_NODE_VERSION"
fi
}

Expand Down

0 comments on commit c3477e4

Please sign in to comment.