<commit_before>#!/bin/bash

rc=0

: ${FIREWALLA_HOME:=/home/pi/firewalla}
source ${FIREWALLA_HOME}/platform/platform.sh

if [[ ${UNAME} == "aarch64" ]]; then
    exit 0; # no need to manage nvm installation for arm 64
fi

node8_10_exists() {
    node_version=$(${FIREWALLA_HOME}/bin/node -v 2>/dev/null)
    test ${node_version:0:2} == 'v8' || test ${node_version:0:3} == 'v10'
    return $?
}

node8_10_exists && {
    logger "Node v8 already exists"
    exit 0
}

logger "Start install Node8 with NVM"

: ${NVM_DIR:=/home/pi/.nvm}
: ${NVM_VERSION:=0.33.6}
: ${NODE_VERSION:="8.7.0"}

bash ${FIREWALLA_HOME}/scripts/prep/nvm_install

source $NVM_DIR/nvm.sh

nvm install $NODE_VERSION || rc=1<commit_msg>do not install node 8.7 for x86<commit_after>#!/bin/bash

rc=0

: ${FIREWALLA_HOME:=/home/pi/firewalla}
source ${FIREWALLA_HOME}/platform/platform.sh

if [[ ${UNAME} != "armv7l" ]]; then
    exit 0; # no need to manage nvm installation for arm 64
fi

node8_10_exists() {
    node_version=$(${FIREWALLA_HOME}/bin/node -v 2>/dev/null)
    test ${node_version:0:2} == 'v8' || test ${node_version:0:3} == 'v10'
    return $?
}

node8_10_exists && {
    logger "Node v8 already exists"
    exit 0
}

logger "Start install Node8 with NVM"

: ${NVM_DIR:=/home/pi/.nvm}
: ${NVM_VERSION:=0.33.6}
: ${NODE_VERSION:="8.7.0"}

bash ${FIREWALLA_HOME}/scripts/prep/nvm_install

source $NVM_DIR/nvm.sh

nvm install $NODE_VERSION || rc=1
{'fraction_non_alphanumeric': 0.17614035087719299, 'fraction_numerical': 0.0456140350877193, 'mean_word_length': 4.166666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5508863', 'n_tokens_mistral': 638, 'n_tokens_neox': 602, 'n_words': 119}