# Fix for https://www.shellcheck.net/wiki/SC2148 # shellcheck shell=bash node_common_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" project_root="$node_common_DIR/../.." # shellcheck source=../versions source "$node_common_DIR"/../versions # shellcheck source=../platform source "$node_common_DIR"/../platform # Get platform-specific node directory nodejs_dirname_var="nodejs_dirname_${platform}" nodejs_dirname="${!nodejs_dirname_var}" nodejs_dist_dir="framework/binaries/$nodejs_dirname" nodejs_bin_dir="$nodejs_dist_dir/bin" nodejs_binary_dir="$project_root/$nodejs_bin_dir" # This might be too restrictive. Or not restrictive enough. PATH="$nodejs_binary_dir":/bin:/usr/bin node_dist_dir="$project_root/$nodejs_dist_dir" export NPM_CONFIG_PREFIX="$node_dist_dir/npm" export NPM_CONFIG_CACHE="$node_dist_dir/cache" export NPM_CONFIG_TMP="$node_dist_dir/tmp" export NODE_PATH="$node_dist_dir/node_modules"