<commit_before>#!/usr/bin/env bash
# @description Install and configure Node

# NVM install to facilitate multiple versions of Nodejs
# Makes it easier to install new versions of Nodejs and
# to work with multiple projects that need different
# versions of Nodejs

set -eo pipefail

export NVM_DIR="/home/vagrant/.nvm"

function nvm_setup() {
  vvv_info " * Checking for NVM"

  if [[ -d "${NVM_DIR}" && -f "${NVM_DIR}/nvm.sh" ]]
  then
    vvv_success " ✓ NVM is already installed, checking for updates"
    cd "${NVM_DIR}"
    noroot git fetch --tags origin
    noroot git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
    cd -
    vvv_info " - Loading nvm"
    [ -s "${NVM_DIR}/nvm.sh" ] && . "${NVM_DIR}/nvm.sh"
    vvv_info " - nvm loaded"
  else
    if [[ -d "${NVMFOLDER}" && ! -f "${NVMFOLDER}/nvm.sh" ]]
    then
      # Possible remnants or something messed
      # up NVM install making it unusable
      vvv_warn " * NVM found in an unusable state, removing it completely"
      rm -rf "${NVM_DIR}"
    fi

    vvv_info " - Installing NVM via git"<commit_msg>resolve additional codacy linter feedback<commit_after>#!/usr/bin/env bash
# @description Install and configure Node

# NVM install to facilitate multiple versions of Nodejs
# Makes it easier to install new versions of Nodejs and
# to work with multiple projects that need different
# versions of Nodejs

set -eo pipefail

export NVM_DIR="/home/vagrant/.nvm"

function nvm_setup() {
  vvv_info " * Checking for NVM"

  if [[ -d "${NVM_DIR}" && -f "${NVM_DIR}/nvm.sh" ]]
  then
    vvv_success " ✓ NVM is already installed, checking for updates"
    cd "${NVM_DIR}"
    noroot git fetch --tags origin
    noroot git checkout $(git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1))
    cd -
    vvv_info " - Loading nvm"
    [ -s "${NVM_DIR}/nvm.sh" ] && . "${NVM_DIR}/nvm.sh"
    vvv_info " - nvm loaded"
  else
    if [[ -d "${NVMFOLDER}" && ! -f "${NVMFOLDER}/nvm.sh" ]]
    then
      # Possible remnants or something messed
      # up NVM install making it unusable
      vvv_warn " * NVM found in an unusable state, removing it completely"
      rm -rf "${NVM_DIR}"
    fi

    vvv_info " - Installing NVM via git"
{'fraction_non_alphanumeric': 0.12978442586889574, 'fraction_numerical': 0.0035195776506819184, 'mean_word_length': 2.9274611398963732, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1440247', 'n_tokens_mistral': 804, 'n_tokens_neox': 777, 'n_words': 261}